Skip to content

Instantly share code, notes, and snippets.

@MatthewManley
Last active March 5, 2022 20:42
Show Gist options
  • Save MatthewManley/27028f1b1ff609f0ea3cbd719016f9a8 to your computer and use it in GitHub Desktop.
Save MatthewManley/27028f1b1ff609f0ea3cbd719016f9a8 to your computer and use it in GitHub Desktop.
// https://gist.github.com/MatthewManley/27028f1b1ff609f0ea3cbd719016f9a8
// I printed this with supports but only inbetween the bottom base and the outer spinning part
// Using Cura (I am sure you can do this in any slicing software), I put a support blocker
// to prevent supports from generating to the upper overhang
// The overhang on the top base has been coming out a little sloppy for me, but its good enough and
// trying to print supports there is quite excessive imo
base_radius = 10; // make it thick
base_height = 2; // how tall the cricle thing on the bottom is`
num_points = 8; // adds more points on the inner shape
middle_height = 100-base_height*2; // how tall the twisty part is
tolerance = 0.5; // how much room to leave inbetween the inner post and the spinny thing
bottom_buffer = 2; // space underneath spinny thing where supports should be generated
//num_slices = 150; // how hi-def we want the curves of the post to be
base_num_points = 60;
width = 2; // the thickness of the spinny thing
outer_twist = 360*2; // twisty
short_height = 25; // the height of the spinny thing
cut_out_center = true;
//center_radius = 6; // How much middle area to cut out
center_twist = -outer_twist;
center_radius = base_radius - width - tolerance - width;
total_height = base_height*2+middle_height;
recomended_slices = total_height / 0.2; // Based off of layer height, probably way overkill
num_slices = 250;
echo("recomended_slices", recomended_slices);
// Inner post including bases, cutting out center if enabled
difference() {
union() {
// Bottom Base
linear_extrude(base_height)
circle(base_radius, $fn=base_num_points);
// Center post twisty thing
linear_extrude(total_height, twist=outer_twist, slices=num_slices)
circle(base_radius-width-tolerance, $fn=num_points);
// Upper Base
translate([0,0,base_height+middle_height])
linear_extrude(base_height)
circle(base_radius, $fn=base_num_points);
}
// Cutting out the center to make it hollow
if (cut_out_center) {
linear_extrude(total_height, twist=center_twist, slices=num_slices)
circle(center_radius, $fn=num_points);
}
}
// The sliding bit
difference() {
// Basically a giant twisty post the same size as the center one
linear_extrude(total_height, twist=outer_twist, slices=num_slices)
circle(base_radius, $fn=num_points);
// Cut out the center
linear_extrude(total_height, twist=outer_twist, slices=num_slices)
circle(base_radius-width, $fn=num_points);
// Cut out the bottom
linear_extrude(base_height+bottom_buffer) square(base_radius*2+5, center=true);
// Cut out above
translate([0,0,base_height+bottom_buffer+short_height])
linear_extrude(base_height+2+middle_height)
square(base_radius*2+5, center=true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment