Generating 3D Meshes from Text

https://news.ycombinator.com/rss Hits: 2
Summary

I recently had a desire to convert text to 3D meshes that I could render and manipulate as part of my Geotoy project and Geoscript language. I did some research into tools and libraries that could solve different pieces of this, and I put together a pipeline that implements the whole thing - yielding nice, 2-manifold 3D meshes with arbitrary fonts, text styles, and more. This post gives an overview of the whole setup and aims to give anyone else looking to implement something similar everything they need to get it working themselves. svg-text-to-path⌗ The first part of the setup uses a JavaScript library called svg-text-to-path. It handles taking arbitrary input text and font params and generating a SVG which contains paths that match the text as closely as possible. Internally, this library handles both fetching + loading the user-specified font as well as performing the text->path conversion itself. It supports different backends for each of these steps. For my use case, I made use of the Google Fonts provider. It was easy to set up and only requires a Google Fonts API key, which can be generated for free. This allows me to use almost any font on Google Fonts to create my meshes. Some failed to load, but only a few and they seemed to be more obscure ones, and I didn’t bother to dig into why. For the text->path conversion, svg-text-to-path defaults to using the fontkit backend. Fontkit is another pure JavaScript library that implements a font engine. I didn’t look into it too deeply, but it seems feature rich and has support for many advanced font features. For my use case, my app runs in the browser. I could have used svg-text-to-path directly within it to generate these paths. However, this text->mesh feature isn’t core to my use case and I didn’t want to bloat the app with it. I also wanted to make it as easy as possible for users to set up, and wanted to be able to use my Google Fonts API key in a secure way. So, I opted to create a tiny little backend service ...

First seen: 2025-11-28 17:41

Last seen: 2025-11-28 18:41