Philip Jones
2018-10-22 08:49:55 UTC
Hi,
I'm new here, so thanks for adding me to the list.
I would like some advice on how to achieve something in openSCAD programming
language. I want to put a row of holes into something where each hole is
larger than the last and with the holes spaced apart by the diameter of the
previous hole (basically a drill size guide).
Something like:
difference()
{
cube([90, 30, 5]);
offset = 0;
for (a = [0: 1: 20])
{
dia = 1.0+(a/10.0);
offset = 4 + (2 * dia);
translate([offset, 4, -1])
{
cylinder(h=7, d=dia);
}
}
}
This produces a row of holes of increasing size, but the increasing offset
doesn't work. I think I read that autoSCAD doesn't have "variables" like
other programming languages (clearly 'offset' isn't working how I am
expecting it to) but not being an expert (except perhaps in 'C' which I've
used for about 30 years) I don't really know what that means or how to write
something that would work.
Any advice, or code example would be gratefully received.
PhilipJ
I'm new here, so thanks for adding me to the list.
I would like some advice on how to achieve something in openSCAD programming
language. I want to put a row of holes into something where each hole is
larger than the last and with the holes spaced apart by the diameter of the
previous hole (basically a drill size guide).
Something like:
difference()
{
cube([90, 30, 5]);
offset = 0;
for (a = [0: 1: 20])
{
dia = 1.0+(a/10.0);
offset = 4 + (2 * dia);
translate([offset, 4, -1])
{
cylinder(h=7, d=dia);
}
}
}
This produces a row of holes of increasing size, but the increasing offset
doesn't work. I think I read that autoSCAD doesn't have "variables" like
other programming languages (clearly 'offset' isn't working how I am
expecting it to) but not being an expert (except perhaps in 'C' which I've
used for about 30 years) I don't really know what that means or how to write
something that would work.
Any advice, or code example would be gratefully received.
PhilipJ