Files
Shopping-Card-Opener/chip_handle.scad
Bernd Mueller 25628aa4a4 first push
2026-04-05 11:08:36 +02:00

180 lines
7.1 KiB
OpenSCAD

/*
================================================================================
ATARI & FIREBEE SHOPPING TROLLEY KEY (Multi-Material Edition)
Version: 3.2.0
License: Creative Commons - Attribution - Non-Commercial - Share Alike (CC-BY-NC-SA)
================================================================================
USER MANUAL:
1. Ensure the following SVG files are in the same folder as this .scad file:
- logo_atari.svg (Front side of the round chip)
- logo_firebee.svg (Back side of the round chip)
- logo_text.svg (Back side on the handle/grip)
2. Use the 'export_mode' variable below to switch between parts for export.
3. For a multi-color print on the AD5X:
- Set export_mode = "chip"; -> Render (F6) -> Export STL as 'base.stl'
- Set export_mode = "atari"; -> Render (F6) -> Export STL as 'inlay_atari.stl'
- Set export_mode = "firebee"; -> Render (F6) -> Export STL as 'inlay_firebee.stl'
- Set export_mode = "text"; -> Render (F6) -> Export STL as 'inlay_text.stl'
4. Import all 4 STLs into your slicer (e.g., OrcaSlicer) simultaneously.
5. When asked "Load as a single object with multiple parts?", select YES.
6. Assign your 4 filaments to the respective parts.
OPTIMAL PRINT SETTINGS (0.4mm Nozzle):
- Layer Height: 0.15mm (0.2mm for first layer)
- Wall Loops: 4 (Crucial for mechanical strength of the chip and keyhole)
- Top/Bottom Shells: 5
- Infill: 30% (Gyroid or Honeycomb recommended)
- First Layer Speed: 15-20 mm/s (Slow is vital for the fine inlays on the bed)
- Cooling: 100% after layer 2
- Prime Tower: Enabled (To prevent color bleeding between the 4 colors)
- Z-Hop: 0.4mm (Prevents the nozzle from scarring finished color areas)
================================================================================
*/
// --- GLOBAL SETTINGS ---
$fn = 100; // Detail level for circular geometries
// --- EXPORT CONTROL ---
// "preview" -> Visualizes all colors together
// "chip" -> The main body with all hollowed-out pockets
// "atari" -> The inlay for the front Atari logo
// "firebee" -> The inlay for the back Firebee logo
// "text" -> The inlay for the text on the handle
export_mode = "preview";
// --- DIMENSIONS & PARAMETERS ---
chip_radius = 11.5; // Standard 23mm diameter
chip_height = 2.4; // Total thickness
logo_depth = 0.6; // Depth of the engravings (approx. 4 layers at 0.15mm)
max_logo_size = (chip_radius * 2) * 0.70; // Scaling factor for round logos
// Handle (Grip) Parameters
handle_length = 45; // Length from the bottom edge of the chip to the end
handle_width = 16; // Width of the rectangular grip
handle_corner_radius = 3;
taper_start_y = -7.5; // Y-coordinate where the chip begins to taper into the handle
hole_diameter = 5;
hole_offset_bottom = 7; // Hole center distance from the bottom edge
// Margin & Spacing for handle text
handle_margin = 2;
hole_clearance = 2; // Space between the hole and the text
taper_clearance = 2; // Space before the handle tapers into the chip
// --- FILENAMES ---
file_atari = "logo_atari.svg";
file_firebee = "logo_firebee.svg";
file_text = "logo_text.svg";
// --- CALCULATIONS FOR TEXT PLACEMENT ---
hole_top_edge_y = (-chip_radius - handle_length + hole_offset_bottom) + (hole_diameter/2);
text_limit_bottom = hole_top_edge_y + hole_clearance;
text_limit_top = taper_start_y - taper_clearance;
available_text_length = abs(text_limit_top - text_limit_bottom);
text_y_position = text_limit_bottom + (available_text_length / 2);
// --- LOGO MODULES (2D DEFINITIONS) ---
module module_logo_atari() {
render()
translate([0, 2, 0]) // Manual alignment for specific SVG geometry
resize([max_logo_size, max_logo_size, 0], auto=true)
offset(delta = 0.01) // Closes paths to prevent mesh errors
import(file_atari, center = true);
}
module module_logo_firebee() {
render()
// Mirroring on the Y-axis (vertical) so it "flies up" on the back side
// mirror([0, 1, 0])
resize([max_logo_size, max_logo_size, 0], auto=true)
offset(delta = 0.01)
import(file_firebee, center = true);
}
module module_logo_text() {
render()
mirror([1, 0, 0]) // Mirror for correct legibility on the bottom side
rotate([0, 0, 90]) // Rotate to align with handle axis
// Resize to fit perfectly within calculated handle area
resize([available_text_length, handle_width - (2 * handle_margin), 0], auto=true)
offset(delta = 0.01)
import(file_text, center = true);
}
// --- GEOMETRY MODULES ---
module module_handle_shape() {
difference() {
hull() {
// Chord calculation: circle width at taper start point
chord_length = 2 * sqrt(pow(chip_radius, 2) - pow(taper_start_y, 2));
translate([-chord_length/2, taper_start_y - 0.1, -chip_height/2])
cube([chord_length, 0.1, chip_height]);
// Rounded end of the handle
end_y_pos = -chip_radius - handle_length + handle_corner_radius;
translate([-(handle_width/2 - handle_corner_radius), end_y_pos, 0])
cylinder(h = chip_height, r = handle_corner_radius, center = true);
translate([(handle_width/2 - handle_corner_radius), end_y_pos, 0])
cylinder(h = chip_height, r = handle_corner_radius, center = true);
}
// Keyhole subtraction
translate([0, -chip_radius - handle_length + hole_offset_bottom, 0])
cylinder(h = chip_height + 2, r = hole_diameter/2, center = true);
}
}
// --- FINAL ASSEMBLY ---
// 1. MAIN KEY BODY (Chip and handle with engraved pockets)
if (export_mode == "preview" || export_mode == "chip") {
difference() {
union() {
color("Grey") cylinder(h = chip_height, r = chip_radius, center = true);
color("Grey") module_handle_shape();
}
// Pocket for Atari (Top)
translate([0, 0, chip_height/2 - logo_depth + 0.01])
linear_extrude(height = logo_depth + 0.1, convexity = 10)
module_logo_atari();
// Pocket for Firebee (Bottom)
translate([0, 0, -chip_height/2 - 0.1])
linear_extrude(height = logo_depth + 0.1, convexity = 10)
module_logo_firebee();
// Pocket for Text (Bottom)
translate([0, text_y_position, -chip_height/2 - 0.1])
linear_extrude(height = logo_depth + 0.1, convexity = 10)
module_logo_text();
}
}
// 2. ATARI INLAY (Top Color)
if (export_mode == "preview" || export_mode == "atari") {
color("Cyan") translate([0, 0, chip_height/2 - logo_depth])
linear_extrude(height = logo_depth, convexity = 10)
module_logo_atari();
}
// 3. FIREBEE INLAY (Bottom Color A)
if (export_mode == "preview" || export_mode == "firebee") {
color("Orange") translate([0, 0, -chip_height/2])
linear_extrude(height = logo_depth, convexity = 10)
module_logo_firebee();
}
// 4. HANDLE TEXT INLAY (Bottom Color B)
if (export_mode == "preview" || export_mode == "text") {
color("Lime") translate([0, text_y_position, -chip_height/2])
linear_extrude(height = logo_depth, convexity = 10)
module_logo_text();
}