Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SHOW_PRINTING_AIDS = true;
MINIMUM_LAYER_HEIGHT = .2;
SHOW_CROSS_SECTION = false;
CROSS_SECTION_LENGTH = 10;
CROSS_SECTION_ROTATION = 30;
lid_wall = 1.8;
lip_and_pot_clearance = 5;
tolerance = .2;
lug_length = 2;
lug_height = 1.6;
mouth_height = 11.4; // lower for watertight lids
mouth_diameter = 78 + tolerance * 2 + lug_length * 2;
mouth_diameter_with_threads = 81;
jar_height = 109;
pot_bottom_diameter = mouth_diameter
- lid_wall * 2
- lip_and_pot_clearance * 2
- tolerance * 2;
pot_top_diameter = pot_bottom_diameter * .8;
pot_height = jar_height * .75 - mouth_height - lid_wall;
plunge = 28;
tower_height = pot_height - plunge;
pot_hole_clearance = 8;
pot_hole_diameter = 4;
skirt_height = 7;
skirt_wall = 1.8;
total_outer_diameter = mouth_diameter + lid_wall * 2;
$fn = 120;
e = .0123;
module tower() {
ramp_side_length = lid_wall + lip_and_pot_clearance;
if (tower_height > 0) {
difference() {
cylinder(
h = tower_height,
d = total_outer_diameter
);
translate([0, 0, -e]) {
cylinder(
h = tower_height - ramp_side_length + e * 2,
d = mouth_diameter
);
}
translate([0, 0, tower_height - ramp_side_length - e]) {
cylinder(
h = ramp_side_length + e * 2,
d1 = mouth_diameter,
d2 = mouth_diameter - ramp_side_length * 2
);
}
}
}
}
module lid() {
module lid_lugs(
lug_count = 6,
lug_width = 24.5 // adjust this if lugs jut outside
) {
module lug() {
translate([0, -lug_length, 0]) {
cube([lug_width, lug_length, lug_height]);
}
}
for (i = [0 : lug_count]) {
rotate([0, 0, 360 * (i / lug_count)]) {
translate([
lug_width / -2,
mouth_diameter / 2,
0
]) {
lug();
}
}
}
}
difference() {
cylinder(
h = mouth_height + lid_wall,
d = total_outer_diameter
);
translate([0, 0, lid_wall]) {
cylinder(
h = mouth_height + e,
d = mouth_diameter
);
}
translate([0, 0, -e]) {
cylinder(
h = lid_wall + e * 2,
d = pot_bottom_diameter
);
}
}
translate([0, 0, lid_wall + mouth_height - lug_height]) {
lid_lugs();
}
}
module skirt() {
if (skirt_height > 0 && skirt_wall > 0) {
difference() {
cylinder(
h = skirt_height,
d = total_outer_diameter
);
translate([0, 0, -e]) {
cylinder(
h = skirt_height + e * 2,
d = total_outer_diameter - skirt_wall * 2
);
}
}
}
}
module pot(
height = pot_height - tower_height,
sacrificial_bridge = SHOW_PRINTING_AIDS
) {
module pot_holes_ring(
count = 5,
y = pot_top_diameter / 3
) {
for (i = [0 : count]) {
rotate([0, 0, 360 * (i / count)]) {
translate([0, y, 0]) {
cylinder(
h = lid_wall + e * 2,
d = pot_hole_diameter
);
}
}
}
}
row_count = floor(
(pot_top_diameter / 2 - lid_wall) /
(pot_hole_diameter + pot_hole_clearance)
);
pot_holes_z = sacrificial_bridge
? height + MINIMUM_LAYER_HEIGHT
: height - e;
difference() {
translate([0, 0, lid_wall]) {
cylinder(
h = height,
d1 = pot_bottom_diameter + lid_wall * 2,
d2 = pot_top_diameter + lid_wall * 2
);
}
translate([0, 0, lid_wall - e]) {
cylinder(
h = height - lid_wall + e,
d1 = pot_bottom_diameter,
d2 = pot_top_diameter
);
}
translate([0, 0, pot_holes_z]) {
for (i = [0 : row_count]) {
radius = (pot_hole_diameter + pot_hole_clearance) * i;
count = floor(
(radius * 2 * PI) /
(pot_hole_diameter + pot_hole_clearance)
);
pot_holes_ring(max(count, 1), radius);
}
}
}
}
module jar_pot() {
lid_z = tower_height;
skirt_z = tower_height + lid_wall + mouth_height - e;
pot_z = tower_height;
tower();
translate([0, 0, pot_z]) pot();
translate([0, 0, lid_z]) lid();
translate([0, 0, skirt_z]) skirt();
}
rotate_z = SHOW_CROSS_SECTION
? CROSS_SECTION_ROTATION
: $t * 360;
intersection() {
rotate([0, 0, rotate_z]) {
jar_pot();
}
if (SHOW_CROSS_SECTION) {
translate([
-pot_bottom_diameter,
CROSS_SECTION_LENGTH / -2,
pot_height / -2
]) {
cube([
pot_bottom_diameter * 2,
CROSS_SECTION_LENGTH,
pot_height * 2
]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.