Quote

**appjaws1**

I'm just getting confused now, the solution lies somewhere in between but I can't see it

I'm just getting confused now, the solution lies somewhere in between but I can't see it

My algorithm works fine (try it in my previous post): (NumHoles=total number of holes,First=first hole radius, Gap=gap between holes, Increase=radius increase in each hole size)

for(i=[0:NumHoles-1])

{

translate([i*(Gap+2*First+i*Increase),0,-500])

cylinder(r=First+i*Increase, h=1000, $fn=20);

}]]>

gap=4;

difference(){

cube([200,18,3]);

for(i=[0:19]){

translate([gap*i+((3.05 + 0.05*i)*2)+((3.05 + 0.05*i+1)*2)+gap*i, 5+0.05*i, -0.1]) cylinder(h=4,r=3.05 + 0.05*i);

}}

This is yours which shows the smaller the hole the smaller the gap

gap=6;

difference(){

cube([200,18,3]);

for(i=[0:19]){

translate([8 + gap*i + 0.1*i*i, 5+0.05*i, -0.1]) cylinder(h=4,r=3.05 + 0.05*i);

}}

I'm just getting confused now, the solution lies somewhere in between but I can't see it]]>

Gap = 2; // Gap between holes

First=5; // Radius of first hole

Increase=0.05; // Radius size increase per hole

Margin=5; // Border around block

HolesX=2*(NumHoles*First)+(NumHoles-1)*(Gap+NumHoles*Increase); // Total X length of holes

HolesY=2*(First+(NumHoles-1)*Increase); // Diameter of largest hole

difference()

{

translate([-Margin-First,-Margin-HolesY/2,0])

cube ([2*Margin+HolesX,2*Margin+HolesY,5]);

Holes();

}

module Holes()

{

for(i=[0:NumHoles-1])

{

translate([i*(Gap+2*First+i*Increase),0,-500])

cylinder(r=First+i*Increase, h=1000, $fn=20);

}

}]]>

difference(){

cube([200,18,3]);

for(i=[0:19]){

translate([8 + 10*i +

}}]]>

cube([200,18,3]);

for(i=[0:19]){

translate([5 + 5*i, 6+0.05*i, -0.1]) cylinder(h=4,r=3.05 + 0.05*i);

}}

[attachment 63922 holes1.png]

This is what I tried and as you can see the gaps between holes are reducing as the holes get larger. What I wanted was the gap between holes to remain the same.

difference(){

cube([200,18,3]);

for(i=[0:19]){

translate([5 + 10*i+3.05 + 0.05*i, 5+0.05*i, -0.1]) cylinder(h=4,r=3.05 + 0.05*i);

}}

[attachment 63923 holes2.png]

Any thoughts?]]>

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.

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.

Sorry, typo in 4th line. The final 5*i should be 0.05*i.]]>

here is how I constructed it:

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);

In your case for holes ranging from 3.0 to 5.0mm with 0.1m increment step and 0.05mm gap, the call would be

BlockOfHoles(n=21,r=1.5,step=0.05,gap=0.05,height=3,margin=1);

]]>

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.]]>

difference(){

cube ([100,8,3]);

for (x= [1:5:100]){

for (y=[3.0:0.05:4.9]){

translate([x,3+y,-0.1]) cylinder(h=4,r=y+0.05);

}}

It will be obvious that for each value of x it produced all values of y, I only want 1 value of y for each value of x but y increased by 0.05.

My maths is so poor that I can't see how to do this.

Thanks for any help]]>