Skip to content

Instantly share code, notes, and snippets.

@nmeum
Last active July 13, 2023 19:13
Show Gist options
  • Save nmeum/c79e82bd118a0e93261d6f781724380b to your computer and use it in GitHub Desktop.
Save nmeum/c79e82bd118a0e93261d6f781724380b to your computer and use it in GitHub Desktop.
aeg-coffee-grinder-lid
// body
top_width = 95;
bottom_width = 80;
total_length = 122;
depth = 11;
thickness = 1.5;
// bottom circle
bottom_radius = 60;
y_off_bot = sqrt(exp(ln(bottom_radius)*2) - exp(ln(bottom_width/2)*2));
// top circle
top_radius = 120;
y_off_top = sqrt(exp(ln(top_radius)*2) - exp(ln(top_width/2)*2));
module body() {
polygon(points=[
[0+(top_width-bottom_width)/2, 0],
[top_width-(top_width-bottom_width)/2, 0],
[top_width, total_length],
[0, total_length]]
);
// bottom circle
translate([(top_width-bottom_width)/2,0,0])
intersection() {
translate([0,-bottom_radius,0])
square([bottom_width,bottom_radius]);
translate([bottom_width/2,y_off_bot,0])
circle(r = bottom_radius, $fn = 100);
}
// top circle
translate([0,total_length,0]) {
intersection() {
translate([top_width/2,-y_off_top,0])
circle(r = top_radius, $fn = 100);
square([top_width,top_width]);
}
}
}
module outer_shape() {
minkowski() {
body();
circle(r = thickness, $fn = 100);
}
}
linear_extrude(height=thickness) {
outer_shape();
}
linear_extrude(height=depth) {
difference() {
outer_shape();
body();
}
}
Display the source blob
Display the rendered blob
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment