From eefed5942f8d5e0b1a91bf9ffc3673fc52cb3cd8 Mon Sep 17 00:00:00 2001 From: VG Date: Sat, 10 Dec 2016 17:30:02 +0100 Subject: work on front panel --- cad/assembly.py | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'cad/assembly.py') diff --git a/cad/assembly.py b/cad/assembly.py index 7380963..a687462 100644 --- a/cad/assembly.py +++ b/cad/assembly.py @@ -24,9 +24,9 @@ def motherboard_holes(datum=parameters.motherboard_datum): def motherboard_hole_objects(datum=parameters.motherboard_datum): - height = parameters.motherboard_size[2] + gap + height = parameters.motherboard_size[2] + 2*gap return union()([ - translate([h[0], h[1], 0])(cylinder(h=height, r=3.96/2, center=True)) + translate([h[0], h[1], -gap])(cylinder(h=height, r=3.96/2)) for h in motherboard_holes(datum) ]) @@ -34,14 +34,12 @@ def motherboard_hole_objects(datum=parameters.motherboard_datum): def motherboard(): hole_objects = motherboard_hole_objects() size = parameters.motherboard_size - board = cube(size, center=True) - cooler = translate([-size[0]/2 + 100, - size[1]/2 - 120 - 30, - size[2]/2])(cube([120, 120, 65])) - ramblock = translate([-size[0]/2 + 87, - -size[1]/2 + 30, - size[2]/2])(cube([145, 35, 30])) - objects = board - hole_objects + cooler + ramblock + board = cube(size) + cooler = translate([100, size[1] - 120 - 30, size[2]])( + cube([120, 120, 65]) + ) + ramblock = translate([87, 30, size[2]])(cube([145, 35, 30])) + objects = board + hole_objects + cooler + ramblock return color(parameters.colors.motherboard)(render()(objects)) @@ -92,9 +90,20 @@ def wood_rear_plate(): def wood_front_plate(): thick = parameters.wood_thickness size = parameters.external_size - objects = cube([size[0], thick, size[2]]) - button = cylinder(r=parameters.button_diameter, h=thick+2*gap) - objects += button + objects = cube([size[0], size[2], thick]) + radius = parameters.button_diameter/2 + button = down(gap)(cylinder(r=radius, h=thick+2*gap)) + button = forward(size[2] - 10 - radius)(button) + button = right(radius + 10 + thick)(button) + objects -= button + front_panel = down(gap)(cube([101, 25, thick+2*gap])) + front_panel = right(size[0]/2 - 101/2)(front_panel) + front_panel = forward(size[2] - 40 - 25)(front_panel) + objects -= front_panel + usb_ports = down(gap)(cube([100, 20, thick+2*gap])) + usb_ports = right(size[0]/2 - 100/2)(usb_ports) + usb_ports = forward(size[2] - 10 - 20)(usb_ports) + objects -= usb_ports return objects @@ -154,5 +163,7 @@ def main(): #d = wood_rear_plate() d = wood_front_plate() #d = motherboard() + #d = motherboard_assembly() + #d = motherboard_support() scad_render_to_file(d, 'assembly.scad', include_orig_code=False) -- cgit v1.2.3