Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created May 3, 2022 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ednisley/033484ea47c3168f1434c3a5a285cb7d to your computer and use it in GitHub Desktop.
Save ednisley/033484ea47c3168f1434c3a5a285cb7d to your computer and use it in GitHub Desktop.
OpenSCAD source code: plastic parts for garden cart handle attachment
// Garden Cart Handle Pivot
// Ed Nisley KE4ZNU 2022-05
Layout = "Show"; // [Show,Build]
/* [Hidden] */
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
Protrusion = 0.1; // make holes end cleanly
inch = 25.4;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
ID = 0;
OD = 1;
LENGTH = 2;
//----------
// Dimensions
// Handle lies along X axis
HandleOD = (7/8) * inch;
BoltOD = (5/16) * inch;
Washer = [BoltOD,1.0 * inch,2.0]; // just for Show
Disk = [BoltOD,62.0,(3/16) * inch];
ClampBase = [(1 + 7/8)*inch,(1 + 1/8)*inch,2.0];
Kerf = 2.0;
CornerRadius = 1.0;
PivotOA = [Disk[OD],Disk[OD],HandleOD + 2*ClampBase.z + 2*Disk[LENGTH]];
//----------------------
// Useful routines
module PolyCyl(Dia,Height,ForceSides=0) { // based on nophead's polyholes
Sides = (ForceSides != 0) ? ForceSides : (ceil(Dia) + 2);
FixDia = Dia / cos(180/Sides);
cylinder(d=(FixDia + HoleWindage),h=Height,$fn=Sides);
}
//----------------------
// Set up parts
module Handle() {
translate([-2*PivotOA.x,0,0])
rotate([0,90,0])
PolyCyl(HandleOD,4*PivotOA.x,24);
}
module Bolt() {
translate([0,0,-PivotOA.z])
PolyCyl(BoltOD,2*PivotOA.z,12);
}
module Pivot() {
difference() {
union() {
hull()
for (i=[-1,1], j=[-1,1]) // rounded block
translate([i*(ClampBase.x/2 - CornerRadius),j*(ClampBase.y/2 - CornerRadius),-PivotOA.z/2])
cylinder(r=CornerRadius,h=PivotOA.z,$fn=4*8);
for (k=[-1,1])
translate([0,0,k*(PivotOA.z/2 - Disk[LENGTH]/2)])
rotate(180/36)
cylinder(d=Disk[OD],h=Disk[LENGTH],$fn=36,center=true);
}
Handle();
Bolt();
cube([2*ClampBase.x,2*ClampBase.y,Kerf],center=true); // slice through center
}
}
//----------
// Build them
if (Layout == "Show") {
rotate([90,-45,0]) {
Pivot();
color("Green")
translate([2*PivotOA.x - PivotOA.x/2,0,0])
Handle();
color("Red")
Bolt();
color("Yellow")
for (k=[-1,1])
translate([0,0,k*(PivotOA.z/2 + Washer[LENGTH])])
rotate(180/36)
cylinder(d=Washer[OD],h=Washer[LENGTH],$fn=36,center=true);
}
}
if (Layout == "Build") {
Offset = 5.0;
intersection() {
translate([-(PivotOA.x/2 + Offset),0,PivotOA.z/2])
Pivot();
translate([-2*PivotOA.x,-2*PivotOA.y,0])
cube([4*PivotOA.x,4*PivotOA.y,PivotOA.z/2],center=false);
}
intersection() {
translate([(PivotOA.x/2 + Offset),0,PivotOA.z/2])
rotate([180,0,0])
Pivot();
translate([-2*PivotOA.x,-2*PivotOA.y,0])
cube([4*PivotOA.x,4*PivotOA.y,PivotOA.z/2],center=false);
}
}
@ednisley
Copy link
Author

ednisley commented May 3, 2022

More details on my blog at https://wp.me/poZKh-aVr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment