openscad-models/light-switches/gfci-paddle-switch.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

142 lines
4.3 KiB
OpenSCAD

// GFCI Paddle Switch Plate
// Parametric recreation of standard Decora/GFCI wall plate
// Rebuilt from STL analysis - fully editable
include <BOSL2/std.scad>
/* [Plate Dimensions] */
// Overall plate dimensions (at top surface)
plate_width = 83.64; // mm - X dimension
plate_height = 126.64; // mm - Y dimension
plate_thickness = 5.0; // mm - Z dimension
/* [Bevel Settings] */
// Bevel creates the tapered edge (top wider than bottom)
bevel_inset = 1.82; // mm - how much smaller bottom is per side
bevel_height = 3.0; // mm - height of beveled section (from top)
/* [Recess Settings] */
// Back recess that fits over electrical box
recess_enabled = true;
recess_depth = 2.0; // mm - depth of recess (from bottom)
recess_inset = 8.0; // mm - inset from outer edge on each side
/* [Paddle Opening] */
// Rectangular opening for paddle switch
opening_width = 34.0; // mm - width of opening
opening_height = 67.0; // mm - height of opening
/* [Corner Rounding] */
plate_corner_radius = 3.0; // mm - outer corner radius
opening_corner_radius = 2.0; // mm - opening corner radius
/* [Screw Holes] */
screw_holes_enabled = true;
screw_hole_diameter = 4.0; // mm
screw_hole_spacing = 83.3; // mm - distance between screw holes (center to center)
/* [Resolution] */
$fn = 64; // smoothness for curves
// ============================================
// CALCULATED VALUES
// ============================================
// Bottom dimensions (smaller due to bevel)
bottom_width = plate_width - (bevel_inset * 2);
bottom_height = plate_height - (bevel_inset * 2);
// Recess dimensions
recess_width = plate_width - (recess_inset * 2);
recess_height = plate_height - (recess_inset * 2);
// ============================================
// MODULES
// ============================================
// Main plate body with beveled edges
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
);
}
// Back recess for electrical box fit
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
);
}
}
// 2D paddle opening shape (simple rectangle with rounded corners)
module paddle_opening_2d() {
rect([opening_width, opening_height], rounding=opening_corner_radius);
}
// 3D paddle opening (for subtraction)
module paddle_opening_3d() {
translate([0, 0, -0.1])
linear_extrude(height = plate_thickness + 0.2)
paddle_opening_2d();
}
// Screw holes
module screw_holes() {
if (screw_holes_enabled) {
// Top screw hole
translate([0, screw_hole_spacing/2, -0.1])
cylinder(h = plate_thickness + 0.2, d = screw_hole_diameter);
// Bottom screw hole
translate([0, -screw_hole_spacing/2, -0.1])
cylinder(h = plate_thickness + 0.2, d = screw_hole_diameter);
}
}
// ============================================
// MAIN ASSEMBLY
// ============================================
module gfci_paddle_plate() {
difference() {
plate_body();
back_recess();
paddle_opening_3d();
screw_holes();
}
}
// Render the plate
gfci_paddle_plate();
// ============================================
// PREVIEW HELPERS (uncomment to debug)
// ============================================
// Preview just the 2D opening shape:
// paddle_opening_2d();
// Preview the opening position:
// #paddle_opening_3d();
// Preview cross-section (cut in half):
// difference() {
// gfci_paddle_plate();
// translate([0, -100, -1]) cube([200, 200, 20]);
// }