Skip to content

Instantly share code, notes, and snippets.

@ednisley
Created June 17, 2025 19:05
Show Gist options
  • Save ednisley/6acba287b78a6bd49c7f507cfa7f6197 to your computer and use it in GitHub Desktop.
Save ednisley/6acba287b78a6bd49c7f507cfa7f6197 to your computer and use it in GitHub Desktop.
OpenSCAD source code: Stop for rolling bed roller
// Rolling Bed roller stops
// Ed Nisley - KE4ZNU
// 2025-06-16
include <BOSL2/std.scad>
Layout = "Show"; // [Show,Build,Roller,Plan]
/* [Hidden] */
HoleWindage = 0.2;
Protrusion = 0.1;
ID = 0;
OD = 1;
LENGTH = 2;
WallThick = 10.0; // default width for things
BaseThick = 3.0; // bottom thickness
RollerOA = [47.2,49.8,40.0]; // min & max dia, length
FrameClearance = 11.0; // max height under bed frame at roller
PadOA = [RollerOA[LENGTH] + 2*WallThick,RollerOA[OD],FrameClearance - 1.0];
//----------
// Define Shapes
module Roller() {
m = (RollerOA[OD] - RollerOA[ID])/2;
RollerR = (m^2 + (RollerOA[LENGTH]^2)/4) / (2*m);
up(RollerOA[OD]/2)
yrot(90)
rotate_extrude($fa=1)
intersection() {
left(RollerR - RollerOA[OD]/2)
circle(r=RollerR,$fa=1);
rect([RollerOA[OD]/2,RollerOA[LENGTH] + 2.0],anchor=LEFT);
}
}
module RollerStop() {
difference() {
cuboid(PadOA,anchor=BOTTOM,rounding=WallThick/2,except=BOTTOM);
up(BaseThick)
Roller();
}
}
//----------
// Build things
if (Layout == "Plan") {
projection(cut=true)
RollerStop();
}
if (Layout == "Roller") {
Roller();
}
if (Layout == "Show") {
RollerStop();
color("Green",0.5)
up(BaseThick)
Roller();
}
if (Layout == "Build") {
RollerStop();
}
@ednisley
Copy link
Author

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