Loading

OpenSCAD Bitmap Fonts Module

by tbuser, published

OpenSCAD Bitmap Fonts Module by tbuser Mar 24, 2010

Description

Update: Added height map support

This is an OpenSCAD module that let's you easily (well kinda) create 3D text. I've emulated the Atari 8-Bit fonts A-Z, a-z, 0-9, and most punctuation. You can create them a letter at a time or pass an array of characters. (OpenSCAD doesn't have any real string manipulation)

It also has a bitmap module that you can use to define your own fonts. It's pretty simple, you pass it an array of numbers (the number defines the height modifier, so a height of 5 and a value in array of 2 would make that pixel 10mm high), then tell it how many bits per row and it creates cubes (of configurable width and height) in a grid and combines them into a single shape.

Be careful when defining your own bitmaps in that you can't have two bits only connected diagonally. Otherwise OpenSCAD will say it's not manifold. For instance you can't have:


0 0 0
0 1 0
0 0 1


But you can have:


0 0 0
0 1 1
0 0 1


I'll try to keep this up to date, but you can always find the latest version on github at github.com/tbuser/openscad-bitmap

Recent Comments

view all

Changing this so that the entire font is in a DXF file following these guidelines (http://thingiverse-production.... would make things a lot easier! All you have to do from there is use it as a font in http://www.thingiverse.com/thi... . If you contact the author of this, he may be able to add it to his collection of fonts which could in turn be added to the Customizer Library to be used!

Sorry I totally forgot to upload the new version. Thanks for reminding me, it should work now.

The new version (2011.04) version of OpenSCAD for Mac gives an error (parser error in line 976). The problem seems to be a few lines earlier:

} else if ( char == "" ) {

The backslash appears to need to be escaped. This works:

} else if ( char == "" ) {

Makes

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

For examples see:

Parametric Name Tag:
thingiverse.com/thing:2055

Parametric Alphabet Block:
thingiverse.com/thing:2056

OpenSCAD Height Map:
thingiverse.com/thing:2070

Include bitmap.scad:



Create the letter "A" where each bit is a 2mm cube (8 x 8 so 16mm total wide) and 5mm high:

block_size = 2;
height = 5;

8bit_char("A", 2, 5);

Create the string "MakerBot". OpenSCAD has no real string or length methods :( so you have to define each character in an array and pass the number of characters:

chars = ["M","a","k","e","r","B","o","t"];
char_count = 8;

8bit_str(chars, char_count, block_size, height);

Comments

You must be logged in to post a comment.

jg16jg on Dec 6, 2013 said:

Changing this so that the entire font is in a DXF file following these guidelines (http://thingiverse-production.... would make things a lot easier! All you have to do from there is use it as a font in http://www.thingiverse.com/thi... . If you contact the author of this, he may be able to add it to his collection of fonts which could in turn be added to the Customizer Library to be used!

theron on May 1, 2011 said:

The new version (2011.04) version of OpenSCAD for Mac gives an error (parser error in line 976). The problem seems to be a few lines earlier:

} else if ( char == "" ) {

The backslash appears to need to be escaped. This works:

} else if ( char == "" ) {

tbuser on Aug 8, 2011 said:

Sorry I totally forgot to upload the new version. Thanks for reminding me, it should work now.

inh on Apr 25, 2011 said:

This is great for making 8-bit art. I was sitting down to write something exactly like this but you beat me to it, thank you! 8-)

danielkschneider on Apr 9, 2010 said:

Add this to http://www.thingiverse.com/thi...

Thanx a lot! Cool addition 8-)

cathalgarvey on Mar 24, 2010 said:

So awesome!! Thanks!

TeamTeamUSA on Mar 24, 2010 said:

Nice!!!

You should put it on GitHub too, so it can versioned and forked.
Braille, i18n, dingbats chars would soon follow.

tbuser on Mar 24, 2010 said:

I added it to github http://github.com/tbuser/opens...

vik on Mar 24, 2010 said:

A Braille version would be useful...

tbuser on Mar 24, 2010 said:

That would be really easy to do. :)

Top