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

zlength = 10;

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

use </d_archive_static/Ttf_2016_002/allerta_stencil.ttf>

difference() {
minkowski() {
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);

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!


Add Comment
Comments are not available for this entry.