Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Paul Kohout
Created April 30, 2017 © CC BY

Twisted Cup

Spin the spiral cup to unscrew it's contents and see if you can figure out how to avoid the dribble holes.

IntermediateShowcase (no instructions)20 hours31
Twisted Cup

Things used in this project

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

cup2.stl

Rendered, ready to slice

Code

cup2.scad

SCAD
Render in OpenSCAD
/*
 A cup divided into multiple spiraling chambers.

 Add vertical slots in wall of cup and holes from all but one of the chambers
 to the tunnels, but not above the point where there is less twist from the top
 than hides the holes.  It takes a twist of (180 + 360/chambers) to completely
 obstruct the view of the inside of the chamber.
*/

$fa=1;
$fs=1;
num_chambers=3;
shafts_per_chamber=5;
num_shafts=num_chambers*shafts_per_chamber;

module pieSlice(r, start_angle, end_angle, offset)
{
  if (end_angle - start_angle > 180)
    echo("pie slice has too wide of an angle");
  intersection() {
    circle(r);
    rotate([0, 0, start_angle])
      translate([-(r+1), offset, 0])
        square(2*(r+1));
    rotate([0, 0, end_angle-180])
      translate([-(r+1), offset, 0])
        square(2*(r+1));
  }
}

module chamber(h, r, offset, twist, chamber_index)
{
  a = 360/num_chambers;
  rotate([0, 0, chamber_index*a])
    linear_extrude(height=h, twist=twist, convexity=10)
      pieSlice(r, 0, a, offset);
}

module hole(h, r, d, shaft_index)
{
  a0 = 180/num_shafts;
  a1 = 360/num_shafts;
  rotate([0, 0, a0+a1*shaft_index])
    translate([r, 0, 0])
      cylinder(h=h, d=d, $fn=36);
}

module slot(h, r, thickness, shaft_index)
{
  a0 = 180/num_shafts;
  a1 = 360/num_shafts;
  rotate([0, 0, a0+a1*shaft_index])
    translate([0, -thickness/2, 0])
      cube([r, thickness, h]);
}

module slots(h, r, thickness, twist)
{
  intersection() {
    union()
      for(chamber_index=[0:num_chambers-2])
        chamber(h, r, thickness/2, twist, chamber_index);
    translate([0, 0, -1])
      union()
        for(shaft_index=[0:num_shafts-1])
          slot(h+2, r+1, thickness, shaft_index);
  }
}

module cup(h, r, thickness, twist)
  difference() {
    cylinder(h=h, r=r);
    translate([0, 0, thickness]) {
      slots(h/2, r-thickness/2, thickness/2, twist/2);
      for(shaft_index=[0:num_shafts-1])
        hole(h, r-thickness/2, thickness/2, shaft_index);
      for(chamber_index=[0:num_chambers-1])
        color(rands(0, 1, 3))
          chamber(h, r-thickness, thickness/2, twist, chamber_index);
    }
  }

cup(100, 40, 4, 720);

Credits

Paul Kohout

Paul Kohout

1 project • 0 followers

Comments