Last active
February 27, 2023 13:56
-
-
Save BarDweller/f467cb58f5c252efda60eaa6777309ca to your computer and use it in GitHub Desktop.
Configurable Tent pole coupler in OpenSCAD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
poleradius = 9/2; //radius of pole | |
socketdepth = 15; //depth required for pole socket (note: not absolute due to ball join) | |
totalplugsize = 20; //exterior depth of pole corner | |
wallthick = 3; //thickness for walls | |
joinangle = 120; //angle to join two connectors at. | |
smoothness = 64; //number of faces for cylinder/sphere. | |
addfrictionfit = true; //set false if friction fit extra is not required. | |
barthick = 2/3; //intrusion amount for friction fit bars | |
//derived values.. | |
//size of sphere for ball joints | |
sphereradius=wallthick+poleradius; | |
//length of cylinder to join ball joints. | |
cyldepth=totalplugsize-(wallthick+poleradius); | |
//pythag, to figure out the amount to increase the cyl length by | |
//to account for the missing sphere top as part of the totalplugsize | |
extradepth=sphereradius - sqrt((sphereradius*sphereradius) - (poleradius*poleradius)); | |
module solidhousing(){ | |
sphere( r=sphereradius, $fn=smoothness, center=true); | |
translate([0,0,(cyldepth+extradepth)/2]) | |
cylinder( r=sphereradius, h=cyldepth+extradepth, $fn=smoothness, center=true); | |
translate([0,0,totalplugsize - sphereradius + extradepth]) | |
sphere( r=sphereradius, $fn=smoothness, center=true); | |
} | |
module plug(){ | |
cylinder( r=poleradius, h=socketdepth, $fn=smoothness, center=true); | |
} | |
module socket() { | |
difference(){ | |
solidhousing(); | |
translate([0,0,-(socketdepth/2) + (totalplugsize+0.01) + extradepth]) | |
plug(); | |
} | |
} | |
module frictionbar(){ | |
translate([0,0,(cyldepth+(sphereradius/2)+extradepth)/2]) | |
cylinder( r=barthick, h=cyldepth+(sphereradius/2), $fn=smoothness, center=true); | |
translate([0,0,(cyldepth+(sphereradius/2)+extradepth)]) | |
cylinder( r1=barthick, r2=0, h=extradepth, $fn=smoothness, center=true); | |
} | |
module frictionbars(){ | |
//thirds coords. | |
top = [0,poleradius,0]; | |
//trig, pythag to figure out x,y for bottom coords. | |
x = sin(60) * poleradius; | |
y = sqrt((poleradius*poleradius) - (x*x)); | |
bottomL = [-x,-y,0]; | |
bottomR = [x,-y,0]; | |
translate( top ) | |
frictionbar(); | |
translate( bottomL ) | |
frictionbar(); | |
translate( bottomR ) | |
frictionbar(); | |
} | |
module solidhousingunion(){ | |
//housing 1 | |
solidhousing(); | |
//housing 2 | |
rotate([joinangle,0,0]) | |
solidhousing(); | |
} | |
module solidplugsunion(){ | |
//plug 1 | |
translate([0,0,-(socketdepth/2) + (totalplugsize+0.01) + extradepth]) | |
plug(); | |
//plug 2 | |
rotate([joinangle,0,0]) | |
translate([0,0,-(socketdepth/2) + (totalplugsize+0.01) + extradepth]) | |
plug(); | |
} | |
module frictionfit(){ | |
//socket 1 | |
frictionbars(); | |
//socket 2 | |
rotate([joinangle,0,0]) | |
frictionbars(); | |
} | |
module connector(){ | |
difference(){ | |
//all housings | |
solidhousingunion(); | |
//all plugs | |
solidplugsunion(); | |
} | |
if(addfrictionfit){ | |
frictionfit(); | |
} | |
} | |
connector(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment