Happy Numbers 0.2

469
Downloads
509
Views
Published on May 22, 2011

Description

Happy Numbers 0.2 is a number system for use in OpenSCAD. I am releasing it into the Public Domain, so you can use and modify it completely freely.

Most OpenSCAD number sets on thingiverse consist of a separate .dxf file for each number. Happy Numbers works differently.

There is a single .svg file that contains a set of numbers in a grid of 'character boxes'. This .svg file has been converted to a .dxf file. Then, in OpenSCAD, you call the char() module; it 'selects' the number you want by using an 'intersection box'. char(1) is the first number, char(2) is the second number, and so on. Thus you can:

*Change the font more easily
*Make your own number sets more easily
*Use numbers in scripts in new and creative ways

Currently it has numbers for these scripts/fonts:
Arabic (LMRomansUnsl10 - sorta resembles Nixie tubes)
Chinese
Devanagari (Hindi, Sanskrit)
Tengwar (Tolkien's Lord of the Rings)
Braille

If you have any questions, feel free to ask.

Making new numbers with your own fonts

If you just want to use this, you can skip down to 'Instructions'. But if you want to make your own kind of numbers, here is the method I used to make this thing.

Step 1. Getting an .svg and then saving as .dxf

The first step is getting the numbers.svg file to have the font you want. This can be as easy as opening up Inkscape and typing the numbers out. Or you could draw the numbers yourself, or find some on the web; as long as they are 'outline' shapes, it should work.

To do the process in Inkscape, here are the basic steps:

0. Open the numbers.svg file
0.1 Go to 'layers' and 'hide' the 'Grid' layer
0.5 Delete old numbers text
1. Create new numbers text
2. Select all of the new text
3. Click Path/Object to Path
4. Click Path/Break Apart
5. Click Object/Ungroup
6. For each character do the following:
6.1 Select the character
6.2 Click "Edit Paths by Nodes" tool
6.3 Hit Ctrl-A (select all nodes)
6.4 Hit the 'insert node' button 2-3 times (slow)
6.5 Hit the 'make straight paths' button
7. Go to 'layers' and 'show' the 'Grid' layer
8. Move each number so it fits in one grid box
9. Go to 'layers' and 'hide' the 'Grid' layer
10. File/Save-As/DXF

There is a great tutorial here (I skip the 'document properties' step):

repraprip.blogspot.com/2011/05/inkscape-to-openscad-dxf-tutorial.html

Step 2. Check alignment

The char() module has some parameters related to the DXF file. They include the x & y offsets to the first 'character box', and the width and height of the character boxes. You may need to check and tweak these if you change the font or characters. This can be done by running the adjustment_table() module and then manually tweaking the settings in char(). Example screenshots have been attached to this project; there are two screenshots with 'unaligned' settings, and one screenshot with 'aligned' settings.

Example

An example usage of these numbers is here, in my TeeTotum:

thingiverse.com/thing:8690

References

Arabic, Chinese, Devanagari, Braille:

Ubuntu Linux, Wikipedia, google image search

Tengwar:

acondia.com/fonts/tengwar/info/numbers.htm
freetengwar.sourceforge.net/

Bugs & Drawbacks

The numbers are currently only 1 through 12. You have to 'manually create' anything larger.

These are not 'scalable' - they are made out of small line segments. If you blow them up too big they will be 'chunky'.

In Openscad, if you don't have GL2 or whatever, the full array of numbers shows up in the preview, not just the char() you choose, making it confusing. When rendered, though, it comes out properly.

Braille is not 'bubbled', it's flat cylinders.

The Tengwar dxf file is too tall, fix with charh=9 (see scad code)

There is no 'size' parameter; you have to use scale().

Using adjustment_table() with GL2 might be confusing

Instructions

Step 1: Download happynumbers.0.2.zip file.

Step 2: Open up the .scad file & copy/paste the char() module into your SCAD project code.

Step 3: Copy the .dxf file you want to use into your SCAD project directory.

Step 4: You should then be able to go char(2) and get a '2' in your project
Tags
Report as inappropriate

You must be logged in to post a comment.

very cool. can't wait to try it.

I know a clock project that is going to need something like this very soon... ;-)

More from donb