diff options
Diffstat (limited to 'cad')
-rw-r--r-- | cad/assembly.py | 55 | ||||
-rw-r--r-- | cad/parameters.py | 2 |
2 files changed, 45 insertions, 12 deletions
diff --git a/cad/assembly.py b/cad/assembly.py index 10e65fe..7380963 100644 --- a/cad/assembly.py +++ b/cad/assembly.py @@ -14,7 +14,7 @@ def motherboard_holes(datum=parameters.motherboard_datum): [datum[0] + 203.2, datum[1] - 22.86], [datum[0] - 20.32, datum[1] - 154.94], - [datum[0], datum[1] - 154.94], + # [datum[0], datum[1] - 154.94], # not on this motherboard [datum[0] + 45.72, datum[1] - 154.94], [datum[0] + 203.2, datum[1] - 154.94], @@ -24,17 +24,25 @@ def motherboard_holes(datum=parameters.motherboard_datum): def motherboard_hole_objects(datum=parameters.motherboard_datum): + height = parameters.motherboard_size[2] + gap return union()([ - translate([h[0], h[1], 0])(cylinder(h=10, r=3.96/2, center=True)) + translate([h[0], h[1], 0])(cylinder(h=height, r=3.96/2, center=True)) for h in motherboard_holes(datum) ]) def motherboard(): hole_objects = motherboard_hole_objects() - mb_size = parameters.motherboard_size - board = cube(mb_size, center=True) - return color(parameters.colors.motherboard)(render()(board - 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 + return color(parameters.colors.motherboard)(render()(objects)) def motherboard_support(): @@ -57,14 +65,37 @@ def motherboard_support(): def wood_rear_plate(): thick = parameters.wood_thickness size = parameters.external_size + connector_size = parameters.connector_panel_size rear_plate = cube([size[0] - 2*thick, thick, size[2]]) - tpsu = [thick + gap, -gap, thick + gap + parameters.powersupply_offset_up] + tpsu = [gap, -gap, thick + gap + parameters.powersupply_offset_up] psu_hole = translate(tpsu)( cube([parameters.powersupply_size[2], thick + 2*gap, parameters.powersupply_size[0]]) ) - return rear_plate - psu_hole + vent_r = 10 + tvent = [size[0] - 2*thick - vent_r - 25, + thick + gap, + connector_size[2] + thick + vent_r + 20] + vent_hole = translate(tvent)( + rotate([90, 0, 0])( + cylinder(r=vent_r, h=thick+2*gap) + ) + ) + tconnector = [size[0] - 2*thick - 10 - connector_size[0], -gap, thick] + connector_hole = translate(tconnector)( + cube([connector_size[0], thick + 2*gap, connector_size[2]]) + ) + return rear_plate - psu_hole - vent_hole - connector_hole + + +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 + return objects def powersupply(): @@ -90,7 +121,7 @@ def wood_case(): rear_plate = translate([thick + gap, size[1] - thick + 2*gap, 0])( wood_rear_plate() ) - front_plate = cube([size[0], thick, size[2]]) + front_plate = wood_front_plate() all_plates = ( bottom_plate + right_plate + left_plate + rear_plate + front_plate ) @@ -98,7 +129,6 @@ def wood_case(): def main(): - #d = motherboard() thick = parameters.wood_thickness hup = parameters.motherboard_support_mount_height \ + parameters.motherboard_support_size[2]/2 \ @@ -114,12 +144,15 @@ def main(): motherboard_assembly ) ) - #d = wood_rear_plate() - psu = translate([parameters.powersupply_size[2] + 2*thick + gap, + psu = translate([parameters.powersupply_size[2] + thick + gap, parameters.external_size[1] - thick - gap - parameters.powersupply_size[1], thick + gap + parameters.powersupply_offset_up])( rotate([0, -90, 0])(powersupply()) ) d += psu + #d = motherboard() + #d = wood_rear_plate() + d = wood_front_plate() + #d = motherboard() scad_render_to_file(d, 'assembly.scad', include_orig_code=False) diff --git a/cad/parameters.py b/cad/parameters.py index 9d50e0a..3ee4523 100644 --- a/cad/parameters.py +++ b/cad/parameters.py @@ -13,7 +13,7 @@ class colors: external_size = [370, 270, 180] connector_panel_size = [158.75, 2, 45] -motherboard_size = [243.84, 243.84, 3] +motherboard_size = [243.84, 225.84, 20] motherboard_support_size = [280, 280, 1] motherboard_datum = [motherboard_size[0]/2 - 243.84 + 34.29, motherboard_size[1]/2 - 10.16] |