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
1 changed files with 7 additions and 4 deletions

View File

@ -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();
}
}