/************/ mag_h = 5; // thickness of the magnets used mag_d = 20; // diameter of the magnets used h = 100; // height of the flowerpot r1 = 80; // max radius of the flowerpot d = 1.5; // wall thickness -= /************/ $fn = 80; r2 =0.66*r1; A = [[0,-r1*0.6,h*0.2],[0,r1*0.6,h*0.2],[0,0,h*0.8]]; difference(){ bak(); translate([h,0,0])cube([2*h,4*h,4*h],center=true); for(i=[0,1,2]) translate(A[i])antimagneet(); } module bak(){ union(){ difference(){ buiten(r1=r1,r2=r2,h=h,d=d); volume(r1=r1,r2=r2,h=h); } intersection(){ translate([-d,-r1,0])cube([2*d,2*r1,h]); buiten(r1=r1,r2=r2,h=h,d=d); } for(i=[0,1,2]) translate(A[i])magneet(); } } module magneet(){ rotate([0,-90,0])cylinder(d1=mag_d+5,d2=mag_d,h=mag_h+d); } module antimagneet(){ rotate([0,-90,0])cylinder(d=mag_d,h=mag_h); } alpha = 0.742755; a = r2; b = r2+ alpha*(r1-r2); H = alpha * h; module volume(r1,r2,h){ cylinder(r1=r1,r2=r2,h=h); } module buiten(r1,r2,h,d){ cylinder(r1=r1+d,r2=r2+d,h=h+d); rand(r=d,R=r1+d); } module rand(r=1,R=10){ rotate_extrude()hull(){translate([R,0])circle(r=r);translate([R+r/8,0])circle(r=r);} } module torus(r=1,R=10){ rotate_extrude()translate([R,0])circle(r=r); }