This program generates a 3d model of a Hanzi/Kanji character using stroke data from Make me a Hanzi. It extrudes the character with the stroke order as the Z dimension.
It does this by splitting up each stroke into parts following the stroke order, and then skewing each part to form a slope.
In this blog post I go into detail about about the inner workings of this program. It uses SolidPython, OpenSCAD, Voronoi diagrams, PCA, and quite a lot of linear algebra.
Watch this YouTube video to see some examples.
The input of the program is a .yml file containing the settings to generate the model.
python src/main.py --out-scad main.scad --stl true --out-stl main.stl --settings examples/ai.yml --parts strokes
See src/base_settings.yml for all configuration options.
Make sure you have OpenSCAD installed. If you're on Apple Silicon, make sure to download the Universal version and not the Intel version.
# Create a venv or similar, then:
pip3 install -r requirements.txt
- Generate strokes STLs and plate,pillars STLs
- Verify design
- Import to PrusaSlicer
- Split to objects (top menu)
- Export from PrusaSlicer as STL
- Import in Cura
- Use tree supports and raft to slice and print (preset available at res/cura-preset.curaprofile)
Please use black
(pip install black
) for formatting.