discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

New library: attachable_text3d

JG
Jonathan Gilbert
Tue, May 2, 2023 1:18 AM

Those of you using BOSL2's attachment feature may have had a need to attach
not just text to objects, but to other text, or a need to attach objects to
text. Today, BOSL2 can't do that on its own, because it just doesn't have
the geometry dimensions of fonts within OpenSCAD; text3d()-produced
models do not today support children.

Last November I ended up needing to augment this behavior for a project,
and ended up cobbling together BOSL2 and fontmetrics, a library that
contains measured font dimensions suitable for knowing what size text will
be produced at.

Now, I've factored this marriage out into its own project for general use,
and it's now available here:
https://github.com/jon-gilbert/openscad_attachable_text3d

This project provides an attachable_text3d() module that works pretty
much as you'd expect: given some text, it will measure the dimensions of
that text using fontmetrics, build a boundary box around where that text
should be, and then construct an attachable 3D model of that text using
BOSL2's attachable() and text3d() modules.

Find full documentation on its use, including some of the world's most
boring examples, at
https://github.com/jon-gilbert/openscad_attachable_text3d/wiki

I'm pretty pleased with it! You might find it as useful as I did, and
please feel free to bang on it some. Sing out in the project's Issues if
you have any specific questions.

[image: image.png]

Those of you using BOSL2's attachment feature may have had a need to attach not just text to objects, but to other text, or a need to attach objects to text. Today, BOSL2 can't do that on its own, because it just doesn't have the geometry dimensions of fonts within OpenSCAD; `text3d()`-produced models do not today support children. Last November I ended up needing to augment this behavior for a project, and ended up cobbling together BOSL2 and fontmetrics, a library that contains measured font dimensions suitable for knowing what size text will be produced at. Now, I've factored this marriage out into its own project for general use, and it's now available here: https://github.com/jon-gilbert/openscad_attachable_text3d This project provides an `attachable_text3d()` module that works pretty much as you'd expect: given some text, it will measure the dimensions of that text using `fontmetrics`, build a boundary box around where that text should be, and then construct an attachable 3D model of that text using BOSL2's `attachable()` and `text3d()` modules. Find full documentation on its use, including some of the world's most boring examples, at https://github.com/jon-gilbert/openscad_attachable_text3d/wiki I'm pretty pleased with it! You might find it as useful as I did, and please feel free to bang on it some. Sing out in the project's Issues if you have any specific questions. [image: image.png] -- - Jon Gilbert jong@jong.org / jgilbertsjc@gmail.com