From 521f0315bb0dbb7d33735e82e94d2a9b185c94f1 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 23 Jul 2011 14:34:26 -0300 Subject: [PATCH] cad/test2/button.scad: added overlaps to eliminate artefacts at coincident faces --- cad/test2/button.scad | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cad/test2/button.scad b/cad/test2/button.scad index 4a7b060..f764b10 100644 --- a/cad/test2/button.scad +++ b/cad/test2/button.scad @@ -35,7 +35,8 @@ module fillet_line(x, r) { translate([-x/2, 0, 0]) difference() { - cube([x, r, r]); + translate([0, -epsilon, -epsilon]) + cube([x, r+epsilon, r+epsilon]); translate([0, r, r]) rotate([0, 90, 0]) translate([0, 0, -epsilon]) @@ -191,10 +192,10 @@ module button_base() { translate([0, 0, -but_base_z]) difference() { - rbox(but_base_x, but_base_y, but_base_z, but_corner_r); - rbox_chamfer_top(but_base_x, but_base_y, but_base_z, + rbox(but_base_x, but_base_y, but_base_z+epsilon, but_corner_r); + rbox_chamfer_top(but_base_x, but_base_y, but_base_z+epsilon, but_corner_r, but_chamfer_r); - rbox_chamfer_bottom(but_base_x, but_base_y, but_base_z, + rbox_chamfer_bottom(but_base_x, but_base_y, but_base_z+epsilon, but_corner_r, but_chamfer_r); } } @@ -204,6 +205,8 @@ module button() { union() { button_top(); + + /* Comment out this line to make CSG previews work */ button_base(); } }