← Back to Models
Soap dish v3 (radial lines)

Soap dish v3 (radial lines)

by Mach3 ·

Radial lines. Optional water collector tray: https://modelrift.com/models/soap-dish-v1-tray

Prompt

lets replace hexes with waved lines

OpenSCAD Code

// Offset Radial Soap Dish
// Concentric arcs anchored to walls for printability

// --- Parameters ---
frame_width = 135;
frame_height = 135;
frame_depth = 24;        
frame_border = 2.0;        
corner_radius = 35;      

// --- Ripple Parameters ---
ring_spacing = 11;       // Distance between ribs
ring_thickness = 2.5;    // Thickness of each arc
// Offset the center point to the top right outside the frame
ripple_offset_x = 120;   
ripple_offset_y = 120;   

// --- Dish Cutout Parameters ---
dish_radius = 220;       
dish_depth = 16;         

$fn = 100;               

// --- Calculations ---
sphere_z_offset = (frame_depth - dish_depth) + dish_radius;
// Calculate max distance to cover the opposite corner
max_dist = sqrt(pow(ripple_offset_x + frame_width/2, 2) + pow(ripple_offset_y + frame_height/2, 2));

// --- Main Render ---
difference() {
    union() {
        // 1. Outer Border Frame
        difference() {
            rounded_square(frame_width, frame_height, frame_depth, corner_radius);
            
            // Interior Cutout
            translate([0, 0, -1])
                rounded_square(frame_width - frame_border*2, frame_height - frame_border*2, frame_depth + 2, corner_radius - frame_border);
        }

        // 2. Anchored Arc Fill
        intersection() {
            // Keep arcs inside the frame boundary
            rounded_square(frame_width - frame_border, frame_height - frame_border, frame_depth, corner_radius - frame_border/2);
            
            // Generate rings from the offset center
            translate([ripple_offset_x, ripple_offset_y, 0])
                concentric_rings(max_dist, ring_spacing, ring_thickness, frame_depth);
        }
    }

    // 3. Concave Scoop
    // Cuts the top of the arcs and frame to hold the soap
    translate([0, 0, sphere_z_offset])
        sphere(r = dish_radius);
}

// --- Modules ---

module concentric_rings(max_r, spacing, thick, height) {
    // Start from 0 to max_r, though only arcs hitting the frame will be rendered
    for (r = [0 : spacing : max_r]) {
        difference() {
            cylinder(h = height, r = r + thick/2);
            translate([0, 0, -0.5])
                cylinder(h = height + 1, r = r - thick/2);
        }
    }
}

module rounded_square(w, h, z, r) {
    translate([-w/2 + r, -h/2 + r, 0])
    hull() {
        cylinder(h=z, r=r);
        translate([w - 2*r, 0, 0]) cylinder(h=z, r=r);
        translate([0, h - 2*r, 0]) cylinder(h=z, r=r);
        translate([w - 2*r, h - 2*r, 0]) cylinder(h=z, r=r);
    }
}