openscad-models/light-switches/gfci-paddle-switch-extended-offset.scad
Cal Corum de88c8b794 Add countersinks and recessed screw holes to extended GFCI plates
- Add 5mm diameter, 2mm deep countersinks around outer screw holes (front face)
- Make main pill-shaped screw holes recessed from back (3.5mm deep)
- Leaves 1.5mm solid wall on front face for clean appearance
- Add STL exports for all light switch plate variants

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 14:50:27 -06:00

162 lines
6.0 KiB
OpenSCAD

// GFCI Paddle Switch Plate - Extended Size with X Offset
// Custom oversized plate with OFF-CENTER paddle opening
// Opening and screw holes at X=0, plate extends asymmetrically
include <BOSL2/std.scad>
/* [Plate Dimensions] */
// Asymmetric plate: 2.5" left of center, 4.5" right of center
plate_left = 63.5; // mm (2.5 inches) - distance from center to left edge
plate_right = 114.3; // mm (4.5 inches) - distance from center to right edge
plate_width = 177.8; // mm - total X dimension (7 inches)
plate_x_offset = 25.4; // mm (1 inch) - plate center offset from opening
plate_height = 230.0; // mm - Y dimension (unchanged)
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
/* [Paddle Opening] */
// Rectangular opening for paddle switch (same as standard plate)
opening_width = 34.0; // mm - width of opening
opening_height = 67.0; // mm - height of opening
/* [Corner Rounding] */
plate_corner_radius = 3.0; // mm
opening_corner_radius = 2.0; // mm
/* [Screw Holes] */
screw_holes_enabled = true;
screw_hole_height = 6.0; // mm - vertical dimension (was diameter)
screw_hole_width = 14.0; // mm - horizontal dimension (250% of height)
screw_hole_spacing = 83.3; // mm - distance between main screw holes
main_screw_recess_depth = 3.5; // mm - depth from back face (Z=5), leaves solid wall on front
// Outer screw holes (smaller, beyond the main holes)
outer_screw_holes_enabled = true;
outer_screw_hole_offset = 6.35; // mm (0.25 inches) beyond main holes
outer_screw_hole_diameter = 2.68; // mm (67% of main hole diameter)
// Countersink around outer screw holes (front face)
countersink_enabled = true;
countersink_diameter = 5.0; // mm - total diameter of recess
countersink_depth = 2.0; // mm - depth of recess into front face
/* [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
// Offset in X so opening remains at origin
translate([plate_x_offset, 0, 0])
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
// Offset in X to match plate body
translate([plate_x_offset, 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);
}
module paddle_opening_3d() {
translate([0, 0, -0.1])
linear_extrude(height = plate_thickness + 0.2)
paddle_opening_2d();
}
module screw_holes() {
if (screw_holes_enabled) {
// Main screw holes: recessed from back face (positive Z), solid wall on front
main_screw_start_z = plate_thickness - main_screw_recess_depth;
// Top main screw hole (pill-shaped, horizontal)
translate([0, screw_hole_spacing/2, main_screw_start_z])
linear_extrude(height = main_screw_recess_depth + 0.1)
rect([screw_hole_width, screw_hole_height], rounding=screw_hole_height/2);
// Bottom main screw hole (pill-shaped, horizontal)
translate([0, -screw_hole_spacing/2, main_screw_start_z])
linear_extrude(height = main_screw_recess_depth + 0.1)
rect([screw_hole_width, screw_hole_height], rounding=screw_hole_height/2);
}
if (outer_screw_holes_enabled) {
// Top outer screw hole (above top main hole)
translate([0, screw_hole_spacing/2 + outer_screw_hole_offset, 0]) {
// Through-hole
translate([0, 0, -0.1])
cylinder(h = plate_thickness + 0.2, d = outer_screw_hole_diameter);
// Countersink on front face
if (countersink_enabled)
translate([0, 0, -0.1])
cylinder(h = countersink_depth + 0.1, d = countersink_diameter);
}
// Bottom outer screw hole (below bottom main hole)
translate([0, -screw_hole_spacing/2 - outer_screw_hole_offset, 0]) {
// Through-hole
translate([0, 0, -0.1])
cylinder(h = plate_thickness + 0.2, d = outer_screw_hole_diameter);
// Countersink on front face
if (countersink_enabled)
translate([0, 0, -0.1])
cylinder(h = countersink_depth + 0.1, d = countersink_diameter);
}
}
}
// ============================================
// MAIN ASSEMBLY
// ============================================
module gfci_paddle_plate_extended() {
difference() {
plate_body();
back_recess();
paddle_opening_3d();
screw_holes();
}
}
gfci_paddle_plate_extended();