Site Sponsors:
OpenSCAD ... and the True Type Font! 
We went looking to create a few 'logoed projects recently. Since printing text can be a problem in 3D (strange looking 'As, 'Os, 'Qs, etc.), for best results when hollow-rendering one should us a STENCIL font.



Sadly, far from being universally supported, at the moment modern operating systems never provide any type of stencil-family fonts.

Arriving to the rescue however, today we should note that OpenSCAD will allow us to 'import' a font for ourselves.

Here is an example of using a True Type Font (.ttf) with OpenSCAD:
line1="Randall Nagy";
line2="foo@bar.net";
line3="Soft9000.com";
border=12;

zlength = 10;

zscale = 4;
zscale2 = 7;
zscale3 = 8;

use </d_archive_static/Ttf_2016_002/allerta_stencil.ttf>

difference() {
$fn=32;
minkowski() {
union(){
cube([max(len(line1), len(line2), len(line3)) * zscale + border, zlength, 0.75], center=true);
if(line2||line3) {
translate([0,-15,0]) cube([max(len(line1),len(line2),len(line3))*zscale2+border,15,0.75], center=true);
}
if(line3) {
translate([0,-30,0]) cube([max(len(line1),len(line2),len(line3))*zscale3+border,15,0.75], center=true);
}
}
cylinder(r=3,h=1);
}

font_name = "Allerta";
zhi = 3;
szfont = 8;
union() {
linear_extrude(height = zhi, center=true)
text(line1, font = font_name, "center", size = szfont, valign="center", halign="center");
if(line2) {
translate([0,-15,0]) linear_extrude(height = zhi, center=true)
text(line2, font = font_name, "center", size = szfont, valign="center", halign="center");
}
if(line3) {
translate([0,-30,0]) linear_extrude(height = zhi, center=true)
text(line3, font = font_name, "center", size = szfont, valign="center", halign="center");
}
}
}

Sharing is caring!




[ view entry ] ( 52 views )   |  permalink  |  related link

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Next> Last>>