
Five of these beauties, printed in silver PETG, protect our round fence posts from the rain. Nothing fundamentally new on the OpenSCAD side — but a nice example of how three difference() building blocks turn into a snug, adjustable part.
How the cap is built
Three stacked rings, each "hollowed out" with difference():
- Cap — a truncated cone (
dolat the bottom →douat the top) with a small hole (dh) left in the middle: a drain so no water sits inside. - Middle — a cylinder with an upward-tapering cone cut out of it. That inner taper is the seat that rests on top of the post.
- Base cylinder — the "skirt" pulled downwards that grips the post: outer
dol, hollowdilon the inside.
// diameter inner lower
dil=98;
// diameter inner upper
diu=88;
// height between inner lower & inner upper
hiliu = 10;
// diameter outer lower
dol=105;
// diameter outer upper
dou=30;
// height cap
hc = 10;
// height base cylinder
hl = 10;
// diameter hole in cap
dh = 2;
$fn=100;
// cap
difference() {
translate([0,0,hiliu])
cylinder(d1=dol,d2=dou,h=hc);
// hole in cap
translate([0,0,hiliu])
cylinder(d=dh,h=hc);
}
// middle
difference() {
cylinder(d=dol,h=hiliu);
cylinder(d1=dil,d2=diu,h=hiliu);
}
// base cylinder
difference() {
translate([0,0,-hl])
cylinder(d=dol,h=hl);
translate([0,0,-hl])
cylinder(d=dil,h=hl);
}
Adapting it to your own post
dil/dol— inner and outer diameter: set them to your own post (inner a little larger than the post so the cap goes on).hl— height of the "skirt": how far the cap reaches down over the post.dh— the drain hole; for posts that are already closed on top, it can be left out.
Printing
Outdoors, PETG is the better choice over PLA — more UV-stable and less bothered by damp and heat; hence the five in silver. And this is what the printed caps look like:



