Easy to use solution to convert a 2d image into an stl file. All you need is opencv to load the image and numpy-stl to handle the mesh.
You need the following packages:
- To generate a stl file from an rgb image.
python img2stl.py --img_path images/Lenna.png --save_path stl/Lenna.stl
python img2stl.py --img_path images/Lenna.png --save_path stl/Lenna.stl --scale_size 3 --z_res 0.3
python img2stl.py --img_path images/Lenna.png--save_path stl/Lenna.stl --scale_size 3 --nb_levels 100 --base_depth 10 --z_res 0.3 --xy_res 0.8 Only the arguments img_path and save_path are mandatory.
- For more parameters, look at the help.
python img2stl.py --help| Input Image | Output STL |
|---|---|
![]() |
