Skip to content

lytke/braille

Repository files navigation

braille.scad – OpenSCAD Braille Library

A Grade 1 Braille rendering library for OpenSCAD. Drop braille.scad into your project and add tactile braille text to any 3-D model with a single module call.

Features

  • Renders Grade 1 Braille for letters (a–z, A–Z, æ/ø/å, Æ/Ø/Å), digits (0–9), selected punctuation (, ; : . ? ! ( ) * "), and spaces.
  • Automatically inserts the correct capital indicator, number indicator, and letter indicator cells whenever the character type changes.
  • Two predefined sizesnormal and jumbo — configured in braille.scad, selectable with a single size parameter.
  • Two helper functions let you measure text width before rendering, making layout calculations easy.

File overview

File Description
braille.scad The library — include this in your own projects
example_name_sign.scad Door / name-sign example with embossed text + braille
example_hotel_keyhanger.scad Hotel key-tag example with raised braille on top and engraved text on the underside

Using braille.scad as a module in your project

Copy braille.scad into the same directory as your project file (or into your OpenSCAD library path), then add one of these two lines at the top of your .scad file:

include <braille.scad>   // recommended – also exposes the pattern tables
use     <braille.scad>   // modules and functions only

Quick-start

include <braille.scad>

// Render "Hello" with normal size (default)
braille_text("Hello");

// Render "Room 221" with jumbo size
braille_text("Room 221", size="jumbo");

// Place braille on top of a flat base plate
translate([5, 5, 3])
    braille_text("April 14");

Predefined sizes

Size parameters are defined at the top of braille.scad and can be adjusted there if needed:

Variable Normal Jumbo Description
*_dot_dia 1.8 2.7 Dot diameter (mm)
*_dot_h 0.8 1.0 Dot height (mm)
*_spacing 2.4 3.7 Centre-to-centre dot spacing (mm)
*_cell_adv 7.2 11.1 Horizontal advance per cell (mm)

API reference

braille_text(text, [size], [fn])

Renders a braille string along the +X axis starting at the current origin. Dots are raised along +Z.

Parameter Default Description
text (required) String to render, e.g. "Hello" or "Room 221"
size "normal" Size preset: "normal" or "jumbo"
fn 16 Facets ($fn) for cylinder and fillet circle

braille_cell(pattern, [size], [fn])

Renders a single 6-dot braille cell at the current origin.

Parameter Default Description
pattern (required) 6-element vector [d1,d2,d3,d4,d5,d6]1 = dot present
size "normal" Size preset: "normal" or "jumbo"
fn 16 Facets ($fn) for cylinder and fillet circle

Cell dot layout:

d1  d4
d2  d5
d3  d6

braille_cell_count(text)

Returns the total number of rendered braille cells for text, including any automatically inserted indicator cells. Useful for computing layout widths before rendering.

braille_text_width(text, [size])

Returns the total rendered width in mm for text (braille_cell_count(text) × cell_adv). Default size is "normal".

Integration example

The snippet below shows how to combine normal 3-D geometry with braille_text inside your own module:

include <braille.scad>

module sign_plate(label, width=100, height=40, thickness=3) {
    // Base plate
    cube([width, height, thickness]);

    // Embossed label text on the upper half
    translate([width/2, height*0.7, thickness])
        linear_extrude(height=0.8)
            text(label, size=8, halign="center", valign="center");

    // Braille on the lower half – centred using the helper function
    bw = braille_text_width(label);
    translate([(width - bw) / 2, height*0.25, thickness])
        braille_text(label);
}

sign_plate("Room 5");

License

This project is released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors