openscad-models/light-switches/outlet.scad
Cal Corum 93d5b0f102 Add parametric light switch plate models
Converted STL files to parametric OpenSCAD:
- blank.scad: Blank cover plate
- switch.scad: Single toggle switch
- outlet.scad: Duplex outlet
- switch-switch.scad: Double toggle (2-gang)
- gfci-paddle-switch.scad: Decora/GFCI paddle switch
- gfci-paddle-switch-extended.scad: Custom 153x230mm oversized plate

All plates feature:
- Print-optimized orientation (front face at Z=0, no overhangs)
- Beveled edges matching original design
- Back recess for electrical box fit
- Round screw holes
- BOSL2 library for clean geometry

Includes 2D template (SVG) for paper test-fit printing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 17:42:15 -06:00

118 lines
3.5 KiB
OpenSCAD

// Duplex Outlet Wall Plate
// Standard single-gang duplex receptacle cover
// Parametric OpenSCAD model
include <BOSL2/std.scad>
/* [Plate Dimensions] */
plate_width = 83.64; // mm - X dimension
plate_height = 126.64; // mm - Y dimension
plate_thickness = 5.0; // mm - Z dimension
/* [Bevel Settings] */
bevel_inset = 1.82; // mm - how much smaller bottom is per side
/* [Recess Settings] */
recess_enabled = true;
recess_depth = 2.0; // mm - depth of recess (from bottom)
recess_inset = 8.0; // mm - inset from outer edge
/* [Outlet Opening] */
// Each outlet receptacle opening (oval/rounded rectangle)
outlet_width = 34.0; // mm - width of each outlet opening
outlet_height = 26.0; // mm - height of each outlet opening
outlet_corner_radius = 10.0; // mm - creates rounded/oval shape
outlet_spacing = 39.5; // mm - vertical distance between outlet centers
/* [Screw Hole] */
// Center screw hole between outlets
screw_hole_enabled = true;
screw_hole_diameter = 5.0; // mm
/* [Corner Rounding] */
plate_corner_radius = 3.0; // mm
/* [Resolution] */
$fn = 64;
// ============================================
// CALCULATED VALUES
// ============================================
bottom_width = plate_width - (bevel_inset * 2);
bottom_height = plate_height - (bevel_inset * 2);
recess_width = plate_width - (recess_inset * 2);
recess_height = plate_height - (recess_inset * 2);
// ============================================
// MODULES
// ============================================
module plate_body() {
// Flipped for printing: front face (larger) at Z=0, back (smaller) at Z=5
// This eliminates overhang on beveled edges
prismoid(
size1 = [plate_width, plate_height], // front face (larger) at bottom
size2 = [bottom_width, bottom_height], // back face (smaller) at top
h = plate_thickness,
rounding = plate_corner_radius,
anchor = BOTTOM
);
}
module back_recess() {
if (recess_enabled) {
recess_rounding = max(0.5, plate_corner_radius - recess_inset/4);
// Recess now at top (Z=5) since plate is flipped for printing
translate([0, 0, plate_thickness - recess_depth - 0.01])
prismoid(
size1 = [recess_width, recess_height],
size2 = [recess_width, recess_height],
h = recess_depth + 0.02,
rounding = recess_rounding,
anchor = BOTTOM
);
}
}
// Single outlet opening (rounded rectangle / oval)
module outlet_opening_2d() {
rect([outlet_width, outlet_height], rounding=outlet_corner_radius);
}
// Both outlet openings
module outlet_openings_3d() {
translate([0, 0, -0.1])
linear_extrude(height = plate_thickness + 0.2) {
// Top outlet
translate([0, outlet_spacing/2, 0])
outlet_opening_2d();
// Bottom outlet
translate([0, -outlet_spacing/2, 0])
outlet_opening_2d();
}
}
// Center screw hole
module center_screw_hole() {
if (screw_hole_enabled) {
translate([0, 0, -0.1])
cylinder(h = plate_thickness + 0.2, d = screw_hole_diameter);
}
}
// ============================================
// MAIN ASSEMBLY
// ============================================
module outlet_plate() {
difference() {
plate_body();
back_recess();
outlet_openings_3d();
center_screw_hole();
}
}
outlet_plate();