Skip to content

Instantly share code, notes, and snippets.

@aceat64
Forked from anonymous/Tekton Socket Holders
Created July 11, 2017 16:19
Show Gist options
  • Save aceat64/d7a40bb3f451e6c2b766504bd5ae8255 to your computer and use it in GitHub Desktop.
Save aceat64/d7a40bb3f451e6c2b766504bd5ae8255 to your computer and use it in GitHub Desktop.
OpenScad script to generate socket holder for Tekton sockets
// sae
//socketDiameters = [ 17.081, 17.081, 17.081, 18.263, 20.216, 22.254, 24.398, 26.392, 28.469, 30.591];
//socketLabels = [
//"\u2075/\u2081\u2086", // 5/16
//"\u00b3/\u2088", // 3/8
//"\u2077/\u2081\u2086", // 7/16
//"\u00b9/\u2082", // 1/2
//"\u2079/\u2081\u2086", // 9/16
//"\u2075/\u2088", // 5/8
//"\u00B9\u00B9/\u2081\u2086", // 11/16
//"\u00B3/\u2084", // 3/4
//"\u00b9\u00B3/\u2081\u2086", // 13/16
//"\u2077/\u2088"]; // 7/8
// metric
//socketDiameters = [ 17.190, 17.190, 17.190, 18.206, 20.251, 22.293, 22.293, 24.373, 26.459, 26.459];
//socketLabels = ["10", "11", "12", "13", "14", "15", "16", "17", "18", "19"];
socketDiameters = [ 12.191, 12.191, 12.191, 12.191, 12.191, 13.237, 14.258, 16.220, 17.266, 18.313];
socketLabels = ["4", "5", "6", "7", "8", "9", "10", "11", "12", "13"];
// http://www.engineersedge.com/hardware/square-drive-tools.htm
// 1/4
Am = 6.45; // width of square
Bm = 8.382; // diagonal on across square with rounded corners
Cm = 7.9248; // height of drive end
Dm = 3.810; // plunger height from base
Fm = 2.000; // plunger diameter
plungerRecessed = 0.51;
materialGap = 1; // gap between sides
materialSlot = 0.5;
flexLength = 2;
baseHeight = 3.175;
borderThickness = 3; // border around each socket
offsetFromCenterline = 4;
// 3/8
//Am = 9.63; // width of square
//Bm = 12.7; // diagonal on across square with rounded corners
//Cm = 11.1252; // height of drive end
//Dm = 5.6134; // plunger height from base
//Fm = 3.9624; // plunger diameter
//plungerRecessed = 1.2;
//materialGap = 1.6; // gap between sides
//materialSlot = 0.5;
//flexLength = 3;
//baseHeight = 3.175;
//borderThickness = 3; // border around each socket
//offsetFromCenterline = 3;
edgeRadius = sqrt(2 * Am * Am) - Bm; // radius on corners of drive end
$fn = 24;
difference() {
union() {
// all the drive ends
for(index = [0:len(socketDiameters)-1])
{
socketDiameter = socketDiameters[index];
xOffset = add_up_to(index, socketDiameters);
yOffset = (((index % 2) * 2) - 1 ) * (socketDiameter/2 + offsetFromCenterline) - Am/2;
angle = (((index % 2) * 2) - 1 ) * 45;
translate([xOffset+Am/2,yOffset+Am/2,baseHeight])
rotate([0,0,angle])
translate([-Am/2,-Am/2,0])
driveEnd(plungerRecessed);
// labels
translate([xOffset+Am/2, (((index % 2) * 2) - 1 ) * -2 - 1.5, baseHeight + borderThickness])
linear_extrude(height=1, convexity=512, twist = 0)
text(socketLabels[index], 5, "Calibri:style=Bold", halign = "center");
}
// base
difference() {
hull(){
for(index = [0:len(socketDiameters)-1])
{
socketDiameter = socketDiameters[index];
xOffset = add_up_to(index, socketDiameters);
yOffset = (((index % 2) * 2) - 1 ) * (socketDiameter/2 + offsetFromCenterline) - Am/2;
translate([xOffset + Am/2, yOffset + Am/2, (baseHeight+borderThickness) / 2])
cylinder(r = socketDiameter/2 + borderThickness + 1, h = baseHeight+borderThickness, center = true);
}
}
union(){
for(index = [0:len(socketDiameters)-1])
{
socketDiameter = socketDiameters[index];
xOffset = add_up_to(index, socketDiameters);
yOffset = (((index % 2) * 2) - 1 ) * (socketDiameter/2 + offsetFromCenterline) - Am/2;
translate([xOffset + Am/2, yOffset + Am/2, baseHeight +borderThickness/2])
cylinder(r = socketDiameter/2, h = borderThickness, center = true);
}
}
}
}
// all the drive end negative space
for(index = [0:len(socketDiameters)-1])
{
socketDiameter = socketDiameters[index];
xOffset = add_up_to(index, socketDiameters);
yOffset = (((index % 2) * 2) - 1 ) * (socketDiameter/2 + offsetFromCenterline) - Am/2;
angle = (((index % 2) * 2) - 1 ) * 45;
// negative space
translate([xOffset+Am/2,yOffset+Am/2,0])
rotate([0,0,angle])
translate([-Am/2,-Am/2,0])
driveEndGap();
}
}
// Render the negative space that allows drive end to flex
module driveEndGap() {
union() {
translate([0 - flexLength, Am/2 - materialGap/2, 0])
cube([Am + flexLength * 2, materialGap, Cm + baseHeight + 1]);
translate([0 - flexLength, Am/2, 0])
cylinder(r = materialGap/2, h = baseHeight);
translate([Am + flexLength, Am/2, 0])
cylinder(r = materialGap/2, h = baseHeight);
translate([Am, Am/2, 0])
cube([materialSlot, Am/2+materialSlot/2, baseHeight]);
translate([Am + materialSlot/2, Am + materialSlot/2, 0])
cylinder(r = materialSlot/2, h = baseHeight);
translate([-flexLength, Am, 0])
cube([Am + flexLength + materialSlot/2, materialSlot, baseHeight]);
translate([-flexLength, Am + materialSlot/2, 0])
cylinder(r = materialSlot /2, h = baseHeight);
translate([-materialSlot,-materialSlot/2,0])
cube([materialSlot, Am/2, baseHeight]);
translate([-materialSlot/2,-materialSlot/2,0])
cylinder(r = materialSlot/2, h = baseHeight);
translate([-materialSlot/2,-materialSlot,0])
cube([Am + flexLength + materialSlot/2, materialSlot, baseHeight]);
translate([Am + flexLength, -materialSlot/2, 0])
cylinder(r = materialSlot /2, h = baseHeight);
// match the round corner on the driveEnd
difference(){
translate([0, 0, 0])
cube([edgeRadius, edgeRadius, baseHeight]);
translate([edgeRadius, edgeRadius, 0])
cylinder(r = edgeRadius, h = baseHeight);
}
difference(){
translate([Am-edgeRadius, Am-edgeRadius, 0])
cube([edgeRadius, edgeRadius, baseHeight]);
translate([Am - edgeRadius, Am - edgeRadius, 0])
cylinder(r = edgeRadius, h = baseHeight);
}
}
}
// 3/8 drive end to hold socket
module driveEnd(plungerOffset) {
// positive space
union() {
// main body
//cube([Am, Am, Cm]);
hull() {
translate([edgeRadius, edgeRadius, 0])
cylinder(r = edgeRadius, h = Cm);
translate([Am - edgeRadius, edgeRadius, 0])
cylinder(r = edgeRadius, h = Cm);
translate([Am - edgeRadius, Am - edgeRadius, 0])
cylinder(r = edgeRadius, h = Cm);
translate([edgeRadius, Am - edgeRadius, 0])
cylinder(r = edgeRadius, h = Cm);
}
// plunger ball on one side
translate([Am/2, plungerOffset, Dm])
sphere(r = Fm / 2, center = true);
// plunger ball on one side
translate([Am/2, Am - plungerOffset, Dm])
sphere(r = Fm / 2, center = true);
}
}
// add all integers up to index
function add_up_to(index, vector) = ( index==0 ? vector[0] * 0.65 : vector[index] * 0.65 + add_up_to(index - 1, vector) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment