Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created May 23, 2026 22:33
Show Gist options
  • Select an option

  • Save ednisley/d1d46f5e9a91d21d8872b4ac66fd863b to your computer and use it in GitHub Desktop.

Select an option

Save ednisley/d1d46f5e9a91d21d8872b4ac66fd863b to your computer and use it in GitHub Desktop.
OpenSCAD source code: Tiedown straps for bike rack tray holder
// TPU Tiedown Straps for bike rack tray holder
// Ed Nisley - KE4ZNU
// 2026-05-14
include <BOSL2/std.scad>
Layout = "Build"; // [Show,Build,Chain,Blocks,Front,Rear]
/* [Hidden] */
HoleWindage = 0.2;
Protrusion = 0.01;
NumSides = 4*3*2*4;
Gap = 5.0;
$fn=NumSides;
LinkID = 7.0;
LinkOD = 10.0;
LinkOC = 14.0;
LinkHeight = 4.0;
JointWidth = 2.0;
FrontChainAngle = 30; // from vertical
FrontChainLength = 80.0; // nominal length
RearChainAngle = 20; // from vertical
RearChainLength = 100.0; // nominal length
BlockOA = [80.0,12.0,15.0];
InsertOC = 30.0;
//-----
// Define things
module Chain(n=2) {
render()
difference() {
union() {
hull() {
cyl(LinkHeight,d=JointWidth,anchor=BOTTOM,rounding=0.0);
back((n - 1)*LinkOC)
cyl(LinkHeight,d=JointWidth,anchor=BOTTOM,rounding=0.0);
}
for (i = [0:n-1])
back(i*LinkOC)
cyl(LinkHeight,d=LinkOD,anchor=BOTTOM,rounding=0.0);
}
for (i = [0:n-1])
back(i*LinkOC)
down(Protrusion)
cyl(LinkHeight + 2*Protrusion,d=(LinkID + HoleWindage),anchor=BOTTOM,rounding=-1.0);
}
}
module FrontBlock() {
difference() {
cuboid(BlockOA,anchor=BOTTOM,chamfer=1.0,except=BACK);
for (i = [-1:1])
right(i*InsertOC) down(Protrusion) {
cyl(BlockOA.z + 2*Protrusion,d=4.0 + HoleWindage,anchor=BOTTOM); // screw clearance
cyl(1.5,d=9.0,anchor=BOTTOM); // insert head
cyl(11.0,d=6.0,anchor=BOTTOM); // insert body
}
}
}
module RearBlock() {
up(BlockOA.z/2) fwd(BlockOA.y/2)
difference() {
cuboid(BlockOA,anchor=FRONT,chamfer=1.0,except=BACK);
for (i = [-1:1])
right(i*InsertOC) fwd(Protrusion) {
ycyl(BlockOA.z + 2*Protrusion,d=4.0 + HoleWindage,anchor=FRONT); // screw clearance
ycyl(1.5,d=9.0,anchor=FRONT); // insert head
ycyl(11.0,d=6.0,anchor=FRONT); // insert body
}
}
}
module FrontAssembly(cl=FrontChainLength,ca=FrontChainAngle) {
Links = ceil(cl / LinkOC);
union() {
up(cl*cos(ca)) {
FrontBlock();
back(BlockOA.y/2)
xrot(90)
for (i = [-1,1])
left(i*InsertOC/2)
zrot(-i*ca + 180)
Chain(Links);
}
}
}
module RearAssembly(cl=RearChainLength,ca=RearChainAngle) {
Links = ceil(cl / LinkOC);
union() {
up(cl*cos(ca)) {
RearBlock();
back(BlockOA.y/2)
xrot(90)
for (i = [-1,1])
left(i*InsertOC/2)
zrot(-i*ca + 180)
Chain(Links);
}
}
}
//-----
// Build things
if (Layout == "Chain")
Chain();
if (Layout == "Blocks") {
fwd(BlockOA.y)
FrontBlock();
back(BlockOA.y)
RearBlock();
}
if (Layout == "Front")
FrontAssembly();
if (Layout == "Rear")
RearAssembly();
if (Layout == "Show") {
fwd(BlockOA.y)
FrontAssembly();
back(BlockOA.y)
zrot(180)
RearAssembly();
}
if (Layout == "Build") {
fwd(BlockOA.z + Gap/2)
up(BlockOA.y/2)
xrot(-90)
down(FrontChainLength*cos(FrontChainAngle))
FrontAssembly();
back(BlockOA.z + Gap/2)
zrot(180)
up(BlockOA.y/2)
xrot(-90)
down(RearChainLength*cos(RearChainAngle))
RearAssembly();
}
@ednisley

Copy link
Copy Markdown
Author

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