From a243e9a1f9358613e1e9f4d2e26ecf6930f87d70 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 24 Dec 2025 15:02:28 -0600 Subject: [PATCH] Fix pill-shaped screw hole CSG export issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add epsilon offsets to pill hole geometry to prevent coplanar face issues during STL/3MF export. F6 render was correct but mesh export was dropping the recesses due to CGAL handling of coincident surfaces. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- light-switches/gfci-paddle-switch-extended-offset.scad | 8 +++++--- light-switches/gfci-paddle-switch-extended.scad | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/light-switches/gfci-paddle-switch-extended-offset.scad b/light-switches/gfci-paddle-switch-extended-offset.scad index 593fc1b..7e54929 100644 --- a/light-switches/gfci-paddle-switch-extended-offset.scad +++ b/light-switches/gfci-paddle-switch-extended-offset.scad @@ -107,16 +107,18 @@ module paddle_opening_3d() { 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; + // Start slightly below target to ensure clean CSG intersection + main_screw_start_z = plate_thickness - main_screw_recess_depth - 0.01; + main_screw_cut_height = plate_thickness - main_screw_start_z + 0.1; // 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) + linear_extrude(height = main_screw_cut_height) 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) + linear_extrude(height = main_screw_cut_height) rect([screw_hole_width, screw_hole_height], rounding=screw_hole_height/2); } diff --git a/light-switches/gfci-paddle-switch-extended.scad b/light-switches/gfci-paddle-switch-extended.scad index ca397e4..40deab5 100644 --- a/light-switches/gfci-paddle-switch-extended.scad +++ b/light-switches/gfci-paddle-switch-extended.scad @@ -101,16 +101,18 @@ module paddle_opening_3d() { 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; + // Start slightly below target to ensure clean CSG intersection + main_screw_start_z = plate_thickness - main_screw_recess_depth - 0.01; + main_screw_cut_height = plate_thickness - main_screw_start_z + 0.1; // 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) + linear_extrude(height = main_screw_cut_height) 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) + linear_extrude(height = main_screw_cut_height) rect([screw_hole_width, screw_hole_height], rounding=screw_hole_height/2); }