From 4296080e9b5a609e16f87d6091856693928237d5 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 23 Jul 2011 11:16:40 -0300 Subject: [PATCH] cad/test2/button.py: removed "epsilon" and "noise" --- cad/test2/button.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/cad/test2/button.py b/cad/test2/button.py index 7e58864..dc07fa2 100755 --- a/cad/test2/button.py +++ b/cad/test2/button.py @@ -5,9 +5,6 @@ from cadmium import * -epsilon = 0.01 -noise = epsilon/10 - but_top_x = 10.0 but_top_y = but_top_x+5.0 but_top_z = 1.5 @@ -28,8 +25,7 @@ but_chamfer_r = 0.2 def fillet_line(x, r): s = Box(x, r, r) - s -= Cylinder(r, h = x+2*epsilon). \ - translate(0, 0, -epsilon). \ + s -= Cylinder(r, h = x). \ rotate(Y_axis, 90). \ translate(0, r, r) return s.translate(-x/2, 0, 0) @@ -44,15 +40,14 @@ def fillet_circle(r, fillet_r): def chamfer_line (x, r): - s = Box(x, r+epsilon, r+epsilon) - s -= Cylinder(r, h = x+2*epsilon). \ - translate(0, 0, -epsilon). \ + s = Box(x, r, r) + s -= Cylinder(r, h = x). \ rotate(Y_axis, 90) return s.translate(-x/2, -r, -r) def chamfer_circle(r, fillet_r): - return Box(2*(r+epsilon), 2*(r+epsilon), fillet_r+epsilon). \ - translate(-r-epsilon, -r-epsilon, -fillet_r)- \ + return Box(2*(r), 2*(r), fillet_r). \ + translate(-r, -r, -fillet_r)- \ Cylinder(r-fillet_r, h = fillet_r). \ translate(0, 0, -fillet_r)- \ Torus(r-fillet_r, fillet_r, center = True). \ @@ -103,16 +98,16 @@ def rbox_chamfer_top_corners(x, y, z, r, chamfer_r): s = t else: s += t - return s-rbox_core(x-epsilon, y-epsilon, z, r) + return s-rbox_core(x, y, z, r) def rbox_chamfer_top(x, y, z, r, chamfer_r): s = rbox_chamfer_top_corners(x, y, z, r, chamfer_r) for a in [0, 180]: s += chamfer_line(x-2*r, chamfer_r). \ - translate(0, y/2, z+noise). \ + translate(0, y/2, z). \ rotate(Z_axis, a) s += chamfer_line(y-2*r, chamfer_r). \ - translate(0, x/2, z+noise). \ + translate(0, x/2, z). \ rotate(Z_axis, a+90) return s