$fn = 50; module cup_shape(height, b_rad, t_rad) { cylinder(height, b_rad, t_rad, 0); } module cup(height, b_rad, t_rad) { difference() { cup_shape(height, b_rad, t_rad); translate([0,0,height - 0.85 * height + 0.03]) scale([0.85,0.85,0.85]) cup_shape(height, b_rad, t_rad); } } module holding_cut_in(height, t_rad) { translate([t_rad + 5, -(t_rad), height -5]) cube([10 ,t_rad * 2,10]); } module holding_insert_cut_in(height, t_rad) { rotate([0,0,15]) translate([t_rad + 7, 0, height -5]) cube([15, 20, 50]); } module holding_cut_ins(height, t_rad) { for (i = [0:90:360]) { rotate([0,0,i]) { holding_cut_in(height, t_rad); holding_insert_cut_in(height, t_rad); } } } module outer_cup_form(height, b_rad, t_rad) { difference() { cylinder(height + 10, t_rad + 10, t_rad + 10); translate([0,0,10.1]) cup_shape(height, b_rad, t_rad); holding_cut_ins(height, t_rad); } } module ice_form_barrier(height, b_rad, t_rad) { difference() { cup_shape(height * 0.85, b_rad * 0.85, t_rad * 0.85); translate([-t_rad,5,-1]) cube(height+t_rad); rotate([0,0,180]) translate([-t_rad,5,-1]) cube(height+t_rad); } } module ice_form_barriers(height, b_rad, t_rad) { ice_form_barrier(height, b_rad, t_rad); rotate([0,0,90]) ice_form_barrier(height, b_rad, t_rad); } module inner_cup_form_holder_outer_ring(t_rad) { difference() { cylinder(10, t_rad * 0.85, t_rad *0.85, 0); translate([0,0,-0.5]) cylinder(11, (t_rad * 0.85)*0.85, (t_rad *0.85)*0.85, 0); } } module inner_cup_form_holder_cross_arm(t_rad) { translate([-5,0,0]) cube([10,(t_rad*0.85),10]); } module inner_cup_form_holder_cross(t_rad) { for (i = [0:90:360]) { rotate([0,0,i]) inner_cup_form_holder_cross_arm(t_rad); } } module inner_cup_form_holder_arm_hook(t_rad) { cube([10,10,24]); translate([0,-5,16]) { difference() { cube([10,5,8]); translate([-0.5,5,0]) rotate([120,0,0]) cube([11,10,20]); } } } module inner_cup_form_holder_arm(t_rad) { translate([-5,0,2]) { cube([10,t_rad + 10 + 2, 8]); translate([10,t_rad + 10 + 2,8]) rotate([0,180,0]) inner_cup_form_holder_arm_hook(t_rad); } } module inner_cup_form_holder_arms(t_rad) { for (i = [0:90:360]) { rotate([0,0,i]) inner_cup_form_holder_arm(t_rad); } } module inner_cup_form_holder(height, b_rad, t_rad) { inner_cup_form_holder_outer_ring(t_rad); inner_cup_form_holder_cross(t_rad); inner_cup_form_holder_arms(t_rad); } module inner_cup_form_main(height, b_rad, t_rad) { difference() { cup_shape(height * 0.85, b_rad * 0.85, t_rad * 0.85); translate([0,0,height - 0.85 * height + 0.03]) scale([0.85,0.85,0.85]) cup_shape(height, 10, t_rad); } } module inner_cup_form(height, b_rad, t_rad) { inner_cup_form_main(height, b_rad, t_rad); ice_form_barriers(height, b_rad, t_rad); translate([0,0,height * 0.85]) inner_cup_form_holder(height, b_rad, t_rad); } module example() { color("red") outer_cup_form(70, 30, 40); color("green") translate([0,0,10 + 70 - 70*0.85]) inner_cup_form(70, 30, 40); } module print1(height, b_rad, t_rad) { outer_cup_form(height, b_rad, t_rad); } module print2(height, b_rad, t_rad) { rotate([0,180,0]) inner_cup_form(height, b_rad, t_rad); } example();