poor maths again October 11, 2015 12:22PM |
Registered: 9 years ago Posts: 780 |
Re: poor maths again October 11, 2015 01:52PM |
Registered: 9 years ago Posts: 14,639 |
difference(){ cube([100,8,3]); for(i=[0:19]){ translate([1 + 5*i, 6+0.05*i, -0.1]) cylinder(h=4,r=3.05 + 5*i); } }
Re: poor maths again October 11, 2015 02:06PM |
Registered: 9 years ago Posts: 780 |
Re: poor maths again October 11, 2015 02:29PM |
Registered: 8 years ago Posts: 590 |
module holes( n, // number of holes r, // initial radius step, // increase step for radius gap, // gap between holes height, // height of holes ){ translate([r,0,0])cylinder(r=r,h=height); if(n>1)translate([2*r+gap,0,0])holes(n-1,r+step,step,gap,height); } module BlockOfHoles( n, // number of holes r, // initial radius step, // increase step for radius gap, // gap between holes height, // height of block margin,// margin outside holes ){ difference(){ cube([2*margin+(2*r+(n-1)*step)*n+(n-1)*gap,2*(r+(n-1)*step+margin),height]); translate([margin,r+(n-1)*step+margin,-1])holes(n,r,step,gap,height+2,$fn=24); } } BlockOfHoles(n=10,r=1,step=1,gap=0.5,height=10,margin=1);
BlockOfHoles(n=21,r=1.5,step=0.05,gap=0.05,height=3,margin=1);
Re: poor maths again October 11, 2015 03:09PM |
Registered: 9 years ago Posts: 780 |
Re: poor maths again October 11, 2015 05:14PM |
Registered: 9 years ago Posts: 14,639 |
Quote
appjaws1
Thanks, I can see your approach, but it didn't work and even if it did I would end up with some big holes, when the maximum should be 5mm diameter
Just to clarify, the radius of each hole should increase by 0.05 and the distance between holes should increase by 0.05.
Holes should have a diameter in the range 3.0 to 5.0 in steps of 0.1mm.
Hope thats clearer
Thanks for your help.
Re: poor maths again October 12, 2015 05:06AM |
Registered: 9 years ago Posts: 780 |
Re: poor maths again October 12, 2015 06:17AM |
Registered: 9 years ago Posts: 14,639 |
Re: poor maths again October 12, 2015 08:28AM |
Registered: 9 years ago Posts: 2,472 |
Re: poor maths again October 12, 2015 08:29AM |
Registered: 9 years ago Posts: 780 |
Re: poor maths again October 12, 2015 08:41AM |
Registered: 9 years ago Posts: 2,472 |
Quote
appjaws1
I'm just getting confused now, the solution lies somewhere in between but I can't see it
Re: poor maths again October 12, 2015 08:56AM |
Registered: 9 years ago Posts: 780 |