openscad xl6019
you might want to adjust the holes i've used m3 its draft because one of the holes might be off for you but it should fit the dimension
// --- RENDER CONTROLS ---
show_enclosure = true;
show_lid = true;
// --- XL6019 Dimensions ---
pcb_w = 28.4;
pcb_l = 49.9;
wall = 2.4;
inner_w = pcb_w + 0.5;
inner_l = pcb_l + 0.5;
total_h = 17.1;
// --- LID SPACING & SCALING CONTROLS ---
num_capsules = 6;
capsule_gap = 9.0; // Base distance between capsules
capsule_scale = 1.05; // <--- SCALING: 1.0 is normal, 1.1 is 10% wider stretch
start_y_offset =5.0; // <--- OFFSET: Shifts the whole group along the Y axis
// --- Lid/Hardware Settings ---
lid_thickness = 1.8;
plug_height = 3.6;
snap_clearance = 0.25;
driver_hole_d = 6.0;
slot_w = 18.0;
slot_d = 4.0;
module enclosure() {
difference() {
cube([inner_w + 2wall, inner_l + 2wall, total_h]);
translate([wall, wall, wall]) cube([inner_w, inner_l, total_h + 5]);
// Wire Slots
translate([wall + 5, -1, wall + 2.6]) cube([inner_w - 10, wall + 2, 6]);
translate([wall + 5, inner_l + wall - 1, wall + 2.6]) cube([inner_w - 10, wall + 2, 6]);
}
}
module lid() {
lid_l = inner_l + 2*wall;
difference() { union() { cube([inner_w + 2*wall, lid_l, lid_thickness]); translate([wall + snap_clearance, wall + snap_clearance, lid_thickness]) difference() { cube([inner_w - 2*snap_clearance, inner_l - 2*snap_clearance, plug_height]); translate([1.2, 1.2, -0.1]) cube([inner_w - 2*snap_clearance - 2.4, inner_l - 2*snap_clearance - 2.4, plug_height + 1]); } } // --- CAPSULES WITH SCALING AND OFFSET --- for (i = [0 : num_capsules - 1]) { // Formula: Start Position + (Index * Gap * Scale) y_calc = start_y_offset + (i * capsule_gap * capsule_scale); translate([wall + inner_w/2, y_calc, -1]) hull() { translate([-slot_w/2 + slot_d/2, 0, 0]) cylinder(d=slot_d, h=30, $fn=24); translate([slot_w/2 - slot_d/2, 0, 0]) cylinder(d=slot_d, h=30, $fn=24); } } // --- SCREWDRIVER NOTCHES --- for(y_edge = [0, lid_l]) { for(x_inset = [wall + 4.5, wall + inner_w - 4.5]) { translate([x_inset, y_edge, -1]) cylinder(d=driver_hole_d, h=30, $fn=32); } }}}
// --- Render ---
if (show_enclosure) enclosure();
if (show_lid) translate([show_enclosure ? (inner_w + wall * 5) : 0, 0, 0]) lid();