Quote

**enif**

str(floor(First),".",floor(10*(First-floor(First))+0.5));

Your a star, works great

translate([0,-Margin/2-HolesY/2, 1]) letter(str(floor(First),".",floor(10*(First-floor(First))+0.5)));

Thank you enif]]>

str(floor(First),".",floor(10*(First-floor(First))+0.5));]]>

Quote

**enif**

You could use OpenScad's*str()* function to convert numbers to strings and concatenate strings, see here. E.g.

You could use OpenScad's

letter(str(Increment," mm step"));

Brilliant, thank you works great.

Is there a way to force 1 decimal place, at the moment I have Size=3.0, First=Size but if I use letter(str(First,".0")); I get just 3 not 3.0

edit: sorry the line should be:-

Is there a way to force 1 decimal place, at the moment I have Size=3.0, First=Size but if I use letter(str(First)); I get just 3 not 3.0 so I am using --- letter(str(First,".0")) which solves the problem but only if the First is a whole number.]]>

letter(str(Increment," mm step"));]]>

This is what I have at the moment ( with a lot of help)

Size=3.0;

NumHoles = 8; // Number of holes

Gap = 2.5; // Gap between holes

First=Size; // Diamater of first hole

Increase=0.05; // Radius size increase per hole

Margin=Size+1; // Border around block

base=3;

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

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

font = "Liberation Sans";

letter_size = Size-1;

letter_height = 5;

module Holes(){

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

{

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

cylinder(r=First/2+i*Increase, h=base+1, $fn=20);

}}

module letter(l) {

linear_extrude(height = letter_height) {

text(l, size = letter_size, font = font, halign = "center", valign = "center", $fn = 100);

}}

difference()

{

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

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

Holes();

translate([0,-Margin/2-HolesY/2, base-2]) rotate([0, 0, 0]) letter("3.0");

translate([(HolesX-HolesY+0.5)/2,-Margin/2-HolesY/2, base-2]) rotate([0, 0, 0]) letter("0.05 mm steps");

translate([HolesX-HolesY+0.5,-Margin/2-HolesY/2, base-2]) rotate([0, 0, 0]) letter("3.35");

}

[attachment 64126 holesizecalculator.png]

I would like the letters/numbers to be the result of a calculation, i.e. First, Increase, HolesY

Is this possible?

Thanks for any help

Paul]]>