summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cad/assembly.py37
-rw-r--r--cad/parameters.py6
2 files changed, 27 insertions, 16 deletions
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)
diff --git a/cad/parameters.py b/cad/parameters.py
index 3ee4523..2632728 100644
--- a/cad/parameters.py
+++ b/cad/parameters.py
@@ -14,9 +14,9 @@ class colors:
external_size = [370, 270, 180]
connector_panel_size = [158.75, 2, 45]
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]
+motherboard_support_size = [500, 250, 0.75]
+motherboard_datum = [motherboard_size[0] - 243.84 + 34.29,
+ motherboard_size[1] - 10.16]
motherboard_support_mount_height = 5
powersupply_size = [150, 150, 80]
powersupply_offset_up = 5 + motherboard_support_size[2]