Skip to content

Instantly share code, notes, and snippets.

@adrianwebb
Created May 10, 2015 18:45
Show Gist options
  • Save adrianwebb/a12f3297f26119a55ab7 to your computer and use it in GitHub Desktop.
Save adrianwebb/a12f3297f26119a55ab7 to your computer and use it in GitHub Desktop.
OpenSCAD 3D printed part for connecting stacked Raspberry Pi systems (rear)
//
// Global properties (mm)
//
part_height = 3;
ring_outer_diameter = 13;
ring_inner_diameter = 7;
connector_bridge_length = 89;
connector_bridge_width = 7;
connector_distance = 60;
brace_offset_degrees = 85;
object_resolution = 100;
//
// Reusable modules
//
module ring (h, od, id) {
difference() {
cylinder(h = h, r = (od/2), $fn = object_resolution);
cylinder(h = h, r = (id/2), $fn = object_resolution);
}
}
module connector (bl, bw, h, od, id) {
cube(size = [(bl-id),h,bw], center = true, $fn = object_resolution);
rotate([-90,0,0]) {
translate([(bl/2),0,-1*(h/2)]) {
ring(h = h, od = od, id = id);
}
translate([-1*(bl/2),0,-1*(h/2)]) {
ring(h = h, od = od, id = id);
}
}
}
module brace (bl, d, h, w, id, o = 90, r = 1) {
fl = (sqrt(pow(d/2,2) + pow(bl/2,2)) * 2) - id;
a = asin(bl/fl);
rotate([0,(a+o)*r,0]) {
cube(size = [fl,h,w], center = true, $fn = object_resolution);
}
}
//
// Design definition
//
translate([0,0,(connector_distance/2)]) {
connector(
bl = connector_bridge_length,
bw = connector_bridge_width,
h = part_height,
od = ring_outer_diameter,
id = ring_inner_diameter
);
}
translate([0,0,-1*(connector_distance/2)]) {
connector(
bl = connector_bridge_length,
bw = connector_bridge_width,
h = part_height,
od = ring_outer_diameter,
id = ring_inner_diameter
);
}
brace(
bl = connector_bridge_length,
d = connector_distance,
h = part_height,
w = connector_bridge_width,
id = ring_inner_diameter,
o = brace_offset_degrees
);
brace(
bl = connector_bridge_length,
d = connector_distance,
h = part_height,
w = connector_bridge_width,
id = ring_inner_diameter,
o = brace_offset_degrees,
r = -1
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment