scad/Can Sleeve/Can Sleeve.scad

103 lines
3.5 KiB
OpenSCAD
Raw Permalink Normal View History

2024-06-28 12:25:58 +02:00
// Name on the can
name = "Peter";
2024-06-26 09:12:05 +02:00
// Can height
can_height = 168;// [115:330mL,168:500mL,135:Energy Drink,180:Energy Drink L,146:Soda Sleek]
// Can width
can_dia = 67;// [67:330mL,67:500mL,53:Energy Drink,63:Energy Drink L,58:Soda Sleek]
2024-06-24 15:56:57 +02:00
2024-06-26 09:12:05 +02:00
// Lip height
lip = 15;
// Total wall thickness
thickness = 2.5;
// Inner/Outer Wall thickness
wall = 0.8;//[0.1:0.1:2.4]
// Interior ribs
ribs = 7;// [1:1:9]
2024-06-24 15:56:57 +02:00
2024-06-28 12:29:27 +02:00
include <../lib/defaults.scad>
;
use <../lib/text_on.scad>
;
2024-06-24 15:56:57 +02:00
2024-06-26 09:12:05 +02:00
// For the Preview Crosssection
intersection() {
// To remove unnecessary edges
2024-06-28 12:29:27 +02:00
difference() {
union() {
// Primary Cylinder, inner & outer wall
translate([0, 0, thickness / 2])
union() {
difference() {
cylinder(h = can_height - lip - 2 * thickness, r = can_dia / 2 + thickness, center = true);
cylinder(h = can_height - lip - 2 * thickness + .1, r = can_dia / 2 + thickness - wall, center = true);
}
difference() {
cylinder(h = can_height - lip - 2 * thickness, r = can_dia / 2 + wall, center = true);
cylinder(h = can_height - lip - 2 * thickness + .1, r = can_dia / 2, center = true);
}
}
// Rounded lip
translate([0, 0, (can_height - lip - thickness) / 2])
rotate_extrude()
translate([(can_dia + thickness) / 2, 0, 0])
intersection() {
circle(thickness / 2);
translate([-(thickness + 1) / 2, 0, 0])
square(thickness + 1);
2024-06-26 09:12:05 +02:00
}
2024-06-28 12:29:27 +02:00
// Bottom
translate([0, 0, -(can_height - lip - 3 * thickness) / 2])
2024-06-26 09:12:05 +02:00
rotate_extrude()
2024-06-28 12:29:27 +02:00
translate([can_dia / 2, 0, 0])
intersection() {
union() {
difference() {
circle(thickness);
circle(thickness - wall);
2024-06-26 09:12:05 +02:00
}
2024-06-28 12:25:58 +02:00
circle(wall);
2024-06-28 12:29:27 +02:00
rotate([0, 0, 45])
square([thickness - 2 * wall, thickness * 2 - wall], center = true);
2024-06-28 12:25:58 +02:00
}
2024-06-28 12:29:27 +02:00
translate([0, -thickness, 0])
square(thickness);
2024-06-28 12:25:58 +02:00
}
2024-06-28 12:29:27 +02:00
translate([0, 0, -(can_height - lip - 2 * thickness) / 2])
difference() {
cylinder(h = thickness, r = can_dia / 2, center = true);
rotate([180, 0, 0])
resize([can_dia * .9, can_dia * .9, 0], [true, true, false])
linear_extrude(height = thickness / 2 + .1)
import(file = "1A_MainLogo_Cube_2021.svg", center = true);
2024-06-26 09:12:05 +02:00
}
2024-06-28 12:29:27 +02:00
//
// Ribs for structural strengt & grip
for(i = [-((ribs - 1) / 2):((ribs - 1) / 2)]) {
translate([0, 0, i * (can_height - lip) / (ribs + 1)])
union() {
difference() {
cylinder(h = 2, r = can_dia / 2 + thickness, center = true);
cylinder(h = 2.1, r = can_dia / 2, center = true);
}
rotate_extrude()
translate([can_dia / 2, 0, 0])
scale([.25, 1, 1])
2024-06-28 12:29:27 +02:00
circle(r = 1);
}
}
text_on_cylinder(t = name, r = can_dia / 2 + thickness, h = can_height / 2, size = 10, center = true, cylinder_center = true, extrusion_height = wall, font = "Hack Nerd Font");
2024-06-28 12:29:27 +02:00
}
translate([-1.4,2.1,0])
cylinder(h=can_height, r=2.1, center=true);
2024-06-26 09:12:05 +02:00
}
if ($preview) {
2024-06-28 12:29:27 +02:00
translate([0, 5 + can_dia / 4, 0])
cube([can_dia + 10, 10 + can_dia / 2, can_height + 10], center = true);
translate([0, 0, (thickness + lip) / 2])
%cylinder(h = can_height, d = can_dia, center = true);
2024-06-26 09:12:05 +02:00
}
2024-06-24 15:56:57 +02:00
}