summaryrefslogtreecommitdiffstats
path: root/ice_glass_forms/glass.scad
blob: c41f19d43f1668fc9b82ee0ceee6d1a9642b7e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
$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();