1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 08:19:41 +02:00

cad/test2/button.scad: added overlaps to eliminate artefacts at coincident faces

This commit is contained in:
Werner Almesberger 2011-07-23 14:34:26 -03:00
parent 326cd33967
commit 521f0315bb

View File

@ -35,7 +35,8 @@ module fillet_line(x, r)
{ {
translate([-x/2, 0, 0]) translate([-x/2, 0, 0])
difference() { difference() {
cube([x, r, r]); translate([0, -epsilon, -epsilon])
cube([x, r+epsilon, r+epsilon]);
translate([0, r, r]) translate([0, r, r])
rotate([0, 90, 0]) rotate([0, 90, 0])
translate([0, 0, -epsilon]) translate([0, 0, -epsilon])
@ -191,10 +192,10 @@ module button_base()
{ {
translate([0, 0, -but_base_z]) translate([0, 0, -but_base_z])
difference() { difference() {
rbox(but_base_x, but_base_y, but_base_z, but_corner_r); 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, rbox_chamfer_top(but_base_x, but_base_y, but_base_z+epsilon,
but_corner_r, but_chamfer_r); 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); but_corner_r, but_chamfer_r);
} }
} }
@ -204,6 +205,8 @@ module button()
{ {
union() { union() {
button_top(); button_top();
/* Comment out this line to make CSG previews work */
button_base(); button_base();
} }
} }