← Back to Models
Desktop Trash Bin

Desktop Trash Bin

by Mach3 ·

Small trash bin. change printable part variable to render bin, lid, or assembly, to download separate stl files (do it via editor)

Interactive Preview & Customizer

3D STL viewer with browser-based OpenSCAD rendering on parameter changes.

Loading previewLoading preview...

Which printable part to show

Outer bin width (mm)

step 1

Bin height (mm)

step 1

Corner rounding radius (mm)

step 0.5

Wall thickness (mm)

step 0.1

Radius of vertical flute channels (mm)

step 0.1

Spacing between flute channels (mm)

step 0.5

Lid clearance gap for easier insertion (mm)

step 0.1

Curve smoothness

step 1
WASM compiler loads on first parameter change.
Download current STL

Prompt

design this desktop trash bin (one item)

OpenSCAD Code


// Desktop Trash Bin Simplified - ModelDrift

/* [Output] */
// Which printable part to show
part = "assembly";          // [bin,lid,assembly]

/* [Body] */
// Outer bin width (mm)
width = 130;                // [80:1:220]
// Bin height (mm)
height = 150;               // [60:1:240]
// Corner rounding radius (mm)
corner_radius = 25;         // [6:0.5:60]
// Wall thickness (mm)
wall_thickness = 3;         // [1:0.1:8]

/* [Fluting] */
// Radius of vertical flute channels (mm)
flute_radius = 2;           // [0.4:0.1:6]
// Spacing between flute channels (mm)
flute_spacing = 6;          // [2:0.5:20]

/* [Fit] */
// Lid clearance gap for easier insertion (mm)
tolerance = 0.5;            // [0:0.1:2]

/* [Quality] */
// Curve smoothness
$fn = 64;                   // [32:1:180]

// Render logic
if (part == "bin") {
    bin_body();
} else if (part == "lid") {
    simple_lid();
} else if (part == "assembly") {
    bin_body();
    // Lift lid slightly for visual clarity in assembly
    translate([0, 0, height - 5]) simple_lid();
}

// --- Modules ---

module bin_body() {
    difference() {
        main_shape(width, height, corner_radius);

        // Main hollow interior
        translate([0, 0, wall_thickness])
            main_shape(width - wall_thickness * 2, height, corner_radius - wall_thickness);

        // Recessed ledge for the lid to sit on
        translate([0, 0, height - 8])
            main_shape(width - wall_thickness + 0.1, 9, corner_radius - wall_thickness / 2);

        apply_fluting();
    }
}

module simple_lid() {
    lid_thickness = 4;
    plug_depth = 6;

    union() {
        // Main top plate (fits into the recessed ledge)
        main_shape(width - wall_thickness - tolerance, lid_thickness, corner_radius - wall_thickness / 2);

        // Inner plug (fits into the main bin opening)
        translate([0, 0, -plug_depth])
            main_shape(width - wall_thickness * 2 - tolerance, plug_depth, corner_radius - wall_thickness);
    }
}

// Helper: rounded square body
module main_shape(w, h, r) {
    offset = w / 2 - r;
    hull() {
        translate([offset, offset, 0]) cylinder(h, r, r);
        translate([-offset, offset, 0]) cylinder(h, r, r);
        translate([offset, -offset, 0]) cylinder(h, r, r);
        translate([-offset, -offset, 0]) cylinder(h, r, r);
    }
}

// Helper: vertical fluting
module apply_fluting() {
    side_len = width - (corner_radius * 2);
    num_flutes_side = floor(side_len / flute_spacing);

    for (r = [0, 90, 180, 270]) {
        rotate([0, 0, r]) {
            // Straight sides
            for (i = [0 : num_flutes_side]) {
                translate([-(side_len / 2) + i * flute_spacing, width / 2, 10])
                    cylinder(height - 30, flute_radius, flute_radius);
            }
            // Corners
            for (a = [0 : 10 : 90]) {
                x = (width / 2 - corner_radius) + cos(a) * corner_radius;
                y = (width / 2 - corner_radius) + sin(a) * corner_radius;
                translate([x, y, 10])
                    cylinder(height - 30, flute_radius, flute_radius);
            }
        }
    }
}