1.1 --- a/cartridge.scad Wed Oct 08 13:39:18 2014 +0200
1.2 +++ b/cartridge.scad Wed Oct 08 13:54:46 2014 +0200
1.3 @@ -41,6 +41,10 @@
1.4 APART = 1;
1.5 PCB = 0;
1.6
1.7 + /* To save time (before printing): FILLET = 0; */
1.8 +
1.9 + FILLET = 1;
1.10 +
1.11 /*
1.12 Rounding/fillet radius and additional margin of subtracted
1.13 material. The additional margin helps avoid geometry problems.
1.14 @@ -59,32 +63,35 @@
1.15 /* A fillet performs rounding using a quarter segment of a cylinder. */
1.16
1.17 module fillet(r, h) {
1.18 - translate([0, 0, -h/2])
1.19 + if (FILLET)
1.20 + translate([0, 0, -h/2])
1.21 + difference() {
1.22 + cube([r + extra, r + extra, h + extra]);
1.23 + cylinder(r = r, h = h);
1.24 + }
1.25 + }
1.26 +
1.27 + module fillet_justified(r, h) {
1.28 + if (FILLET)
1.29 difference() {
1.30 cube([r + extra, r + extra, h + extra]);
1.31 cylinder(r = r, h = h);
1.32 }
1.33 }
1.34
1.35 - module fillet_justified(r, h) {
1.36 - difference() {
1.37 - cube([r + extra, r + extra, h + extra]);
1.38 - cylinder(r = r, h = h);
1.39 - }
1.40 - }
1.41 -
1.42 module fillet_torus(radius, rounding) {
1.43 - difference() {
1.44 - cube_at((radius + extra) * 2, (radius + extra) * 2, rounding + extra,
1.45 - 0, 0, 1,
1.46 - 0, 0, 0);
1.47 - union() {
1.48 - rotate_extrude(convexity = 10)
1.49 - translate([radius - rounding, 0, 0])
1.50 - circle(r = rounding);
1.51 - cylinder(r = radius - rounding, h = rounding);
1.52 + if (FILLET)
1.53 + difference() {
1.54 + cube_at((radius + extra) * 2, (radius + extra) * 2, rounding + extra,
1.55 + 0, 0, 1,
1.56 + 0, 0, 0);
1.57 + union() {
1.58 + rotate_extrude(convexity = 10)
1.59 + translate([radius - rounding, 0, 0])
1.60 + circle(r = rounding);
1.61 + cylinder(r = radius - rounding, h = rounding);
1.62 + }
1.63 }
1.64 - }
1.65 }
1.66
1.67 /*