$fn = 64; // --- Dimensions & Parameters --- // Base base_width = 140; base_depth = 40; base_height = 5; corner_radius = 10; // Backplate back_thickness = 6; back_height = 90; // Vaccination Record Pocket pocket_width = 100; pocket_wall = 3; pocket_gap = 4.5; pocket_height = 45; // ID Tag Peg peg_radius = 4; peg_length = 20; peg_cap_radius = 6; peg_cap_thickness = 2; // --- Computed Positions --- back_front_y = base_depth/2 - back_thickness; pocket_block_depth = pocket_wall + pocket_gap + 0.5; pocket_x = -base_width/2 + 5 + (pocket_width + pocket_wall*2)/2; pocket_y = back_front_y - pocket_block_depth/2 + 0.5; peg_x = 55; peg_y = back_front_y; peg_z = back_height - 15; // --- Model --- union() { // 1. Base with rounded front corners hull() { // Rear part (square to match backplate) translate([0, base_depth/4, base_height/2]) cube([base_width, base_depth/2, base_height], center=true); // Front left corner translate([-base_width/2 + corner_radius, -base_depth/2 + corner_radius, base_height/2]) cylinder(h=base_height, r=corner_radius, center=true); // Front right corner translate([base_width/2 - corner_radius, -base_depth/2 + corner_radius, base_height/2]) cylinder(h=base_height, r=corner_radius, center=true); } // 2. Backplate with rounded top corners hull() { // Bottom anchor (matches base to ensure manifold union) translate([0, base_depth/2 - back_thickness/2, base_height/2]) cube([base_width, back_thickness, base_height], center=true); // Top left corner translate([-base_width/2 + corner_radius, base_depth/2 - back_thickness/2, back_height - corner_radius]) rotate([90, 0, 0]) cylinder(h=back_thickness, r=corner_radius, center=true); // Top right corner translate([base_width/2 - corner_radius, base_depth/2 - back_thickness/2, back_height - corner_radius]) rotate([90, 0, 0]) cylinder(h=back_thickness, r=corner_radius, center=true); } // 3. Vaccination Record Pocket translate([pocket_x, pocket_y, base_height + pocket_height/2]) difference() { // Outer block cube([pocket_width + pocket_wall*2, pocket_block_depth, pocket_height], center=true); // Inner slot (shifted to leave front wall and open the back completely to the backplate) translate([0, 1.75, 0.5]) cube([pocket_width, 5.5, pocket_height + 1], center=true); } // 4. ID Tag Peg // Main peg shaft (embedded 1mm into backplate for manifoldness) translate([peg_x, peg_y + 1, peg_z]) rotate([90, 0, 0]) cylinder(h=peg_length + 1, r=peg_radius); // Peg base reinforcement (chamfer) translate([peg_x, peg_y, peg_z]) rotate([90, 0, 0]) cylinder(h=3, r1=peg_radius + 2, r2=peg_radius); // Peg Cap translate([peg_x, peg_y - peg_length + 0.1, peg_z]) rotate([90, 0, 0]) cylinder(h=peg_cap_thickness + 0.1, r=peg_cap_radius); }