Skip to content

Instantly share code, notes, and snippets.

@raidzero
Created September 13, 2018 00:43
Show Gist options
  • Save raidzero/e5cf91d13c5a9c721037be4b13574103 to your computer and use it in GitHub Desktop.
Save raidzero/e5cf91d13c5a9c721037be4b13574103 to your computer and use it in GitHub Desktop.
scad test
$fn = 50;
// distance between holes in the linear bearing
bearing_hole_distance = 18;
// diameter of the m4 holes in the linear bearing
bearing_hole_diameter = 3.9;
// how much space to the left and right of the holes
bearing_plate_padding = 2.5;
// plate thickness
bearing_plate_thickness = 2;
// distance from bearing to chain mount
neck_height = 20;
// cable chain mount hole distance
chain_mount_hole_distance = 14;
// cable chain mount screw hole diameter for m3
chain_mount_hole_diameter = 2.9;
m3_nut_diameter = 5.5;
m3_nut_thickness = 2.4;
module bearing_plate() {
length = bearing_hole_diameter * 2 + bearing_hole_distance + bearing_plate_padding;
height = bearing_hole_diameter + bearing_plate_padding;
thickness = bearing_plate_thickness;
hole_radius = bearing_hole_diameter / 2;
difference() {
cube([length, height, thickness], center = true);
// screw holes
translate([bearing_hole_distance/2, 0, 0])
cylinder(r1 = hole_radius, r2 = hole_radius, h = thickness, center = true);
translate([-bearing_hole_distance/2, 0, 0])
cylinder(r1 = hole_radius, r2 = hole_radius, h = thickness, center = true);
}
}
module plate_neck() {
height = neck_height;
width = bearing_hole_diameter * 2.5;
thickness = bearing_plate_thickness;
y_pos = height/2 - bearing_hole_diameter + bearing_plate_padding;
translate([0, y_pos, 0])
cube([width, height, thickness], center = true);
}
module chain_mount() {
height = chain_mount_hole_diameter + bearing_plate_padding;
width = chain_mount_hole_diameter * 2 + chain_mount_hole_distance + bearing_plate_padding;
thickness = bearing_plate_thickness + 3;
hole_radius = chain_mount_hole_diameter /2;
outer_radius = chain_mount_hole_diameter;
// captive nut cavity depth
nut_recession = m3_nut_thickness;
translate([0, 0, 0]) // does nothing - was only here for experimenting with moving the object
difference() {
hull() {
translate([chain_mount_hole_distance/2, neck_height, 0])
cylinder(r1 = outer_radius+1, r2 = outer_radius, h = thickness, center = true);
translate([-chain_mount_hole_distance/2, neck_height, 0])
cylinder(r1 = outer_radius+1, r2 = outer_radius, h = thickness, center = true);
}
// make screw holes
translate([chain_mount_hole_distance/2, neck_height, 0])
cylinder(r1 = hole_radius, r2 = hole_radius, h = thickness, center = true);
translate([-chain_mount_hole_distance/2, neck_height, 0])
cylinder(r1 = hole_radius, r2 = hole_radius, h = thickness, center = true);
// captive nut holes - 6 faced cylinders
translate([chain_mount_hole_distance/2, neck_height, -nut_recession])
cylinder(r1 = m3_nut_diameter/2, r2 = m3_nut_diameter/2, h = m3_nut_thickness, center = true, $fn = 6);
// captive nut holes
translate([-chain_mount_hole_distance/2, neck_height, -nut_recession])
cylinder(r1 = m3_nut_diameter/2, r2 = m3_nut_diameter/2, h = m3_nut_thickness, center = true, $fn = 6);
}
}
bearing_plate();
plate_neck();
chain_mount();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment