// ============================================
// SaltyLab — Carry Handle
// 150×30×30mm PETG
// Comfortable grip, mounts on top of spine
// ============================================
include <dimensions.scad>

handle_w = 150;
handle_h = 30;
grip_dia = 25;     // Comfortable grip diameter
grip_len = 100;    // Grip section length

module handle() {
    difference() {
        union() {
            // Grip bar (rounded for comfort)
            translate([-grip_len/2, 0, handle_h])
                rotate([0, 90, 0])
                    cylinder(d=grip_dia, h=grip_len, $fn=40);
            
            // Left support leg
            hull() {
                translate([-handle_w/2, -10, 0])
                    cube([20, 20, 3]);
                translate([-grip_len/2, 0, handle_h])
                    rotate([0, 90, 0])
                        cylinder(d=grip_dia, h=5, $fn=40);
            }
            
            // Right support leg
            hull() {
                translate([handle_w/2 - 20, -10, 0])
                    cube([20, 20, 3]);
                translate([grip_len/2 - 5, 0, handle_h])
                    rotate([0, 90, 0])
                        cylinder(d=grip_dia, h=5, $fn=40);
            }
        }
        
        // 2020 extrusion slot (center of base)
        translate([-extrusion_w/2 - tol, -extrusion_w/2 - tol, -1])
            cube([extrusion_w + tol*2, extrusion_w + tol*2, 5]);
        
        // M5 bolt holes for extrusion (2x)
        for (x = [-30, 30]) {
            translate([x, 0, -1])
                cylinder(d=m5_clear, h=5, $fn=25);
        }
        
        // Finger grooves on grip
        for (x = [-30, -10, 10, 30]) {
            translate([x, 0, handle_h])
                rotate([0, 90, 0])
                    cylinder(d=grip_dia + 4, h=5, center=true, $fn=40);
        }
    }
}

handle();
