From 55a45ed2fbde4a396717f14fcd59691c00ffd4c1 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 7 Jan 2012 04:10:00 +0100 Subject: [PATCH] Now with round corners and a hollow inside --- keycap-std.scad | 74 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 31 deletions(-) rewrite keycap-std.scad (65%) diff --git a/keycap-std.scad b/keycap-std.scad dissimilarity index 65% index 469acdd..b4b63ca 100644 --- a/keycap-std.scad +++ b/keycap-std.scad @@ -1,31 +1,43 @@ -//measures are in millimeters -AY=18.5; -AX=19.0; -BY=12.5; -BLX=14.5; -EZ=11.0; -FLZ=14.0; -H=12.75; -CYL_OFF_Z=50; -CYL_DEPTH=0.75; - - -WallThickness=0.75; -ClipWidth=2.2; -ClipDepth=0.75; - -ascfront=FLZ/sqrt(pow(FLZ,2)-pow(H,2)); -asctop=(H-EZ)/sqrt(pow(BLX,2)-pow((H-EZ),2)); - -alpha=asin((H-EZ)/BLX); -beta=asin(H/FLZ); -gamma=90-asin((0.5*(AY-BY))/EZ); - -difference(){ - cube([AX,AY,H]); - rotate(a=gamma,v=[1,0,0]) cube([100,100,100]); - translate([0,AY,0]) rotate(a=90-gamma,v=[1,0,0]) cube([100,100,100]); - translate([0,0,EZ]) rotate(a=-alpha,v=[0,1,0]) translate([-50,0,0]) cube([100,100,100]); - translate([0,AY/2,EZ+CYL_OFF_Z]) rotate(a=90-alpha,v=[0,1,0]) cylinder(h=100,center=true,r=CYL_OFF_Z+CYL_DEPTH,$fa=1); - translate([AX,0,0]) rotate(a=beta-90,v=[0,1,0]) cube([100,100,100]); -} \ No newline at end of file +//measures are in millimeters +AY=18.5; +AX=19.0; +BY=12.5; +BLX=14.5; +EZ=11.0; +FLZ=14.0; +H=12.75; +CYL_OFF_Z=50; +CYL_DEPTH=0.75; + + +WallThickness=0.75; +ClipWidth=2.2; +ClipDepth=0.75; + +//ascfront=FLZ/sqrt(pow(FLZ,2)-pow(H,2)); +//asctop=(H-EZ)/sqrt(pow(BLX,2)-pow((H-EZ),2)); + +alpha=asin((H-EZ)/BLX); +beta=asin(H/FLZ); +gamma=90-asin((0.5*(AY-BY))/EZ); + +module keycap(){ + scale([AX/(AX+1+2),AY/(AY+2+0.01),H/(H+0.01+1)]) + minkowski(){ + difference(){ + cube([AX,AY,H]); + rotate(a=gamma,v=[1,0,0]) cube([100,100,100]); + translate([0,AY,0]) rotate(a=90-gamma,v=[1,0,0]) cube([100,100,100]); + translate([0,0,EZ]) rotate(a=-alpha,v=[0,1,0]) translate([-50,0,0]) cube([100,100,100]); + translate([0,AY/2,EZ+CYL_OFF_Z]) rotate(a=90-alpha,v=[0,1,0]) cylinder(h=100,center=true,r=CYL_OFF_Z+CYL_DEPTH,$fa=1); + translate([AX,0,0]) rotate(a=beta-90,v=[0,1,0]) cube([100,100,100]); + } + cylinder(h=0.01,r=2,$fs=0.6); + //rotate(a=90,v=[1,0,0]) cylinder(h=0.01,r=1,$fs=0.3); + } +} + +difference(){ + keycap(); + translate([WallThickness, WallThickness, 0]) scale(v=[1-2*WallThickness/AX, 1-2*WallThickness/AY, 1-WallThickness/H]) keycap(); +} \ No newline at end of file -- 2.11.4.GIT