Skip to content

Instantly share code, notes, and snippets.

@elizarov
Last active January 17, 2021 08:59
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 elizarov/f77e76a8246ad802155c2ccf51d3aa55 to your computer and use it in GitHub Desktop.
Save elizarov/f77e76a8246ad802155c2ccf51d3aa55 to your computer and use it in GitHub Desktop.
Twisted vase / pen holder
$fs = $preview ? 1 : 0.2;
$fa = $preview ? 3 : 1.0;
rb = 30; // radius of the base
rf = 3; // radius of the side supports
rg = 2; // radius of the cutout groove
n = 10; // number of support twisting in one direcation (total - twice this)
h = 90; // height (mm)
t = 180; // twist anle (degree)
eps = 0.1; // additional tolerance for clean cuts
bh = h/(t/360*n)/4;
// comment out ogroove in preview for cleaner look
difference() {
base();
ogrove();
}
// ---
module wbase2d() {
for(i = [1:n]) {
rotate([0,0,360*i/n])
translate([rb,0,0]) circle(rf);
}
}
module base() {
translate([0,0,bh]) {
linear_extrude(height=h, twist=t) wbase2d();
linear_extrude(height=h, twist=-t) wbase2d();
}
cylinder(h=bh+eps, r=rb+rf);
translate([0,0,bh+h-eps]) {
difference() {
cylinder(h=bh+eps, r=rb+rf);
translate([0,0,-eps])
cylinder(h=bh+3*eps, r=rb-rf);
}
}
}
module obase2d(dir) {
for(i = [1:n]) {
rotate([0,0,360*i/n+dir*t*(bh+eps)/h])
translate([rb+rf,0,0]) circle(rg);
}
}
module ogrove() {
translate([0,0,-eps])
for(dir=[-1, 1])
linear_extrude(
height=h+2*(bh+eps),
twist=dir*(t+t*2*(bh+eps)/h)
)
obase2d(dir);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment