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.
# Create a venv or similar, then:
pip3 install -r requirements.txt
Due to the unavailability of ARM-compatible wheels for Scipy (and other libraries), you can use Miniforge instead: Note: this doesn't always work properly, so your mileage may vary.
cat requirements.txt | xargs -n 1 pip install # this will fail for some packages
conda create -n 3d-hanzi-venv
conda activate 3d-hanzi-venv
while read requirement; do conda install --yes $requirement || pip install $requirement; done < requirements.txt
Scipy issue: scipy/scipy#13409
- 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.