From adef2d239cbb66044184a5f7ef37f0cd139b9cb6 Mon Sep 17 00:00:00 2001 From: david powell Date: Thu, 13 Jun 2013 17:56:03 +0100 Subject: [PATCH 1/3] added a few more sizes --- bearing.scad | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/bearing.scad b/bearing.scad index 2efea7e..d25bc85 100644 --- a/bearing.scad +++ b/bearing.scad @@ -5,6 +5,11 @@ * Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later */ +/* +change list 13/6/2013 + added ,604,606,607,628,629,6200,6201,6202,6203,6205,6206 bearing sizes +*/ + include include @@ -35,12 +40,33 @@ SkateBearing = 608; // Bearing dimensions // model == XXX ? [inner dia, outer dia, width]: function bearingDimensions(model) = - model == 608 ? [8*mm, 22*mm, 7*mm]: - model == 623 ? [3*mm, 10*mm, 4*mm]: - model == 624 ? [4*mm, 13*mm, 5*mm]: - model == 627 ? [7*mm, 22*mm, 7*mm]: - model == 688 ? [8*mm, 16*mm, 4*mm]: - model == 698 ? [8*mm, 19*mm, 6*mm]: + model == 604 ? [4*mm, 12*mm, 4*mm]: + model == 606 ? [6*mm, 17*mm, 6*mm]: + model == 607 ? [7*mm, 19*mm, 6*mm]: + model == 608 ? [8*mm, 22*mm, 7*mm]: + model == 623 ? [3*mm, 10*mm, 4*mm]: + model == 624 ? [4*mm, 13*mm, 5*mm]: + model == 627 ? [7*mm, 22*mm, 7*mm]: + model == 628 ? [8*mm, 24*mm, 8*mm]: + model == 629 ? [9*mm, 26*mm, 8*mm]: + model == 688 ? [8*mm, 16*mm, 4*mm]: + model == 698 ? [8*mm, 19*mm, 6*mm]: + model == 6200 ? [10*mm, 30*mm, 9*mm]: + model == 6201 ? [12*mm, 32*mm, 10*mm]: + model == 6202 ? [15*mm, 35*mm, 11*mm]: + model == 6203 ? [17*mm, 40*mm, 12*mm]: + model == 6205 ? [25*mm, 52*mm, 15*mm]: + model == 6206 ? [30*mm, 62*mm, 16*mm]: + +// +//todo:- +// add +//mr105 5 10 4 +//mr115 5 11 4 +//mr126 6 12 4 +// and other standard sizes +// + [8*mm, 22*mm, 7*mm]; // this is the default From 28f163641700f75a3a6ec603fc7486cee135a57b Mon Sep 17 00:00:00 2001 From: david powell Date: Wed, 19 Jun 2013 18:15:50 +0100 Subject: [PATCH 2/3] Cubic_Array() , Radial_Array() functions --- array.scad | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 array.scad diff --git a/array.scad b/array.scad new file mode 100644 index 0000000..446c5ac --- /dev/null +++ b/array.scad @@ -0,0 +1,139 @@ +// array functions +// by david powell +// licence LGPL V2 or later +// +// this lib provides 2 functions +// Cubic_Array() , and Radial_Array() +// +//Cubic_Array(sx,sy,sz,nx,ny,nz,center){childobject} +// produces a cubic grid of child objects +// sx,sy,sz = spacing for each axis +// nx,ny,nz and number of objects on each axis +// center = true/false on if geometery is centered or not +// +// +//Radial_Array(a,n,r){child object} +// produces a clockwise radial array of child objects rotated around the local z axis +// a= interval angle +// n= number of objects +// r= radius distance +// +// remove // from following line to run test +//Cubic_and_Radial_Array_Test(); + +module Cubic_and_Radial_Array_Test() + { +//center referance point + translate([0,0,0]) + #cube([5,5,5],center=true); + +//cubic array of 5*5*5 objects spaced 10*10*10 center relative + Cubic_Array(10,10,10,5,5,5,center=true) + { + sphere(2.5,center=true,$fn=60); + } + +//a linear array allong x can be derived from the cubic array simply + translate([60,0,0]) + Cubic_Array(10,0,0,5,1,1,center=false) + { + cube([5,5,5],center=true); + } +//a linear array allong y can be derived from the cubic array simply + translate([0,60,0]) + Cubic_Array(0,10,0,1,5,1,center=false) + { + cube([5,5,5],center=true); + } + +//a linear array allong z can be derived from the cubic array simply + translate([0,0,60]) + Cubic_Array(0,0,10,1,1,5,center=false) + { + cube([5,5,5],center=true); + } + +//a grid array allong x,y can be derived from the cubic array simply + translate([0,0,-60]) + Cubic_Array(10,10,0,5,5,1,center=true) + { + cube([5,5,5],center=true); + } + +//radial array of 32 objects rotated though 10 degrees + translate([0,0,0]) + Radial_Array(10,32,40) + { + cube([2,4,6],center=true); + } + +// a radial array of linear arrays + + rotate([45,45,45]) + Radial_Array(10,36,40) + { + translate([0,10,0]) + Cubic_Array(0,10,0,1,5,1,center=false) + { + cube([2,3,4],center=true); + } + } + +} + + +// main lib modules +module Cubic_Array(sx,sy,sz,nx,ny,nz,center) + { + if (center==true) + { + translate([-(((nx+1)*sx)/2),-(((ny+1)*sy)/2),-(((nz+1)*sz)/2)]) + { + for(x=[1:nx]) + { + for(y=[1:ny]) + { + for(z=[1:nz]) + { + translate([x*sx,y*sy,z*sz]) + child(center=true); + } + } + } + } + } + else + { + translate([0,0,0]) + { + for(x=[1:nx]) + { + for(y=[1:ny]) + { + for(z=[1:nz]) + { + translate([x*sx,y*sy,z*sz]) + child(); + } + } + } + } + } + } + +// +//Radial_Array(a,n,r){child object} +// produces a clockwise radial array of child objects rotated around the local z axis +// a= interval angle +// n= number of objects +// r= radius distance +// +module Radial_Array(a,n,r) +{ + for (k=[0:n-1]) + { + rotate([0,0,-(a*k)]) + translate([0,r,0]) + child(); + } +} From 4da430feeb6d4b17b189291859996052efbd0b95 Mon Sep 17 00:00:00 2001 From: david powell Date: Sat, 20 Jul 2013 19:37:44 +0100 Subject: [PATCH 3/3] Cubic_Array() , Radial_Array() function added multiple child support --- array.scad | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/array.scad b/array.scad index 446c5ac..8b075ae 100644 --- a/array.scad +++ b/array.scad @@ -31,6 +31,11 @@ module Cubic_and_Radial_Array_Test() Cubic_Array(10,10,10,5,5,5,center=true) { sphere(2.5,center=true,$fn=60); + cylinder(h=10,r=.5,center=true); + rotate([90,0,0]) + cylinder(h=10,r=.5,center=true); + rotate([0,90,0]) + cylinder(h=10,r=.5,center=true); } //a linear array allong x can be derived from the cubic array simply @@ -76,6 +81,9 @@ module Cubic_and_Radial_Array_Test() Cubic_Array(0,10,0,1,5,1,center=false) { cube([2,3,4],center=true); + cylinder(h=10,r=.5,center=true); + rotate([90,0,0]) + cylinder(h=10,r=.5,center=true); } } @@ -96,7 +104,7 @@ module Cubic_Array(sx,sy,sz,nx,ny,nz,center) for(z=[1:nz]) { translate([x*sx,y*sy,z*sz]) - child(center=true); + for (k = [0:$children-1]) child(k,center=true);; } } } @@ -113,7 +121,7 @@ module Cubic_Array(sx,sy,sz,nx,ny,nz,center) for(z=[1:nz]) { translate([x*sx,y*sy,z*sz]) - child(); + for (k = [0:$children-1]) child(k); } } } @@ -134,6 +142,6 @@ module Radial_Array(a,n,r) { rotate([0,0,-(a*k)]) translate([0,r,0]) - child(); + for (k = [0:$children-1]) child(k); } }