$fn=50; // controls smoothness of curves tol = 0.5; // tolerance between the 2 pieces // pyramid parameters radius = 15; height = 60; // helix parameters spiralNb = 6; // Nb of spirals spiralWidth = radius/10; // // uncomment this line to separate the 2 pieces //translate([radius, radius, 0]) base(height, radius, spiralWidth/2, tol); // generate the "base" part screw(height, radius, spiralWidth/2, tol); // generate the "screw" part module pyramid(height, baseRadius, topRadius) { cylinder(height, radius, topRadius, $fn=12); } module helix(height, radius, tol) { linear_extrude(height, center=false, convexity=10, twist=180) offset(tol) union() { for (i =[1:spiralNb]) { // create evenly distributed circles around the origin rotate(a=i*(360/spiralNb)) translate([radius/2, 0, 0]) circle(r = spiralWidth); // create beams to connect the circles to the origin rotate(a=i*(360/spiralNb)) translate([radius/4, 0, 0]) square([radius/2, 2*spiralWidth], true); }; // create a circle at the origin to be sure that all beams are well connected circle(r = spiralWidth); } } module base(height, baseRadius, topRadius, tol) { color("lightblue") intersection() { difference() { pyramid(height, baseRadius, topRadius); helix(height, baseRadius, tol/2); }; translate([-radius, -radius, 0]) cube([2*radius, 2*radius, 0.7*height]); } } module screw(height, baseRadius, topRadius, tol) { color("lightgreen") intersection() { pyramid(height, baseRadius, topRadius); helix(height, baseRadius, -tol/2); } }