Small Streamlit app for generating customizable 3D nameplates, tags, and fobs, and exporting them as STL files.
The app uses solidpython2 to build the geometry, relies on OpenSCAD for STL generation, and displays the result in the browser with streamlit_stl.
The app supports multiple design types (e.g. squircle fob, square fob) using a dataclass-driven system in designs.py. Each design defines its own geometry and UI controls. You can easily add new designs by subclassing an existing design or creating a new one, then registering it in the DESIGNS dictionary.
To experiment with new shapes or features, use prototype.py as a scratchpad for geometry prototyping before integrating your design into the main app.
For layout work, geometry.py includes helpers to render a SolidPython shape to STL through OpenSCAD, measure its true bounding box back from the mesh, and compute the translate vector needed to center it.
-
Takes a name as input
-
Lets you adjust length, depth, and height
-
Cuts the text into the base shape
-
Adds a small mounting hole
-
Generates an STL for preview and download
-
app.py- Streamlit application and main UI logic -
designs.py- Design classes and registry for different fob/tag types -
geometry.py- STL-based bounding-box and centering helpers for SolidPython shapes -
prototype.py- Geometry prototyping and experimentation (not part of main app flow) -
school_filaments.json- List of school-owned filament names used to filter selectable colours -
requirements.txt- Python dependencies -
packages.txt- System dependency list for streamlit.app
- Python 3.10+
- OpenSCAD available on the system
On Debian/Ubuntu systems:
sudo apt-get update
sudo apt-get install -y openscadCreate a virtual environment, install Python dependencies, and ensure OpenSCAD is installed:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtStart the Streamlit app from the repository root:
streamlit run app.pyThen open the local URL shown by Streamlit in your browser.
- Select a design type from the dropdown (e.g. Key Fob, Square Fob).
- Enter the text to engrave.
- Adjust the dimensions with the sliders.
- Inspect the rendered STL in the browser.
- Download the generated STL file.
packages.txtlistsopenscad, which is required for STL generation.school_filaments.jsonmust contain names that exactly match entries in the Bambu colour catalogue.- If STL generation fails, the app falls back to showing generated SCAD output.
- The default shape is now selectable via the UI. You can add new shapes by editing
designs.py. - Use
prototype.pyto quickly try out new geometry ideas before formalizing them as a new design class. - Call
calculate_shape_bounding_box(shape)to getmin_corner,max_corner,size,center, andtranslation_to_center().
This project is licensed under the terms of the LICENSE file.