Metadata-Version: 2.3
Name: stl-to-voxel
Version: 0.10.1
Summary: Turn STL files into voxels, images, and videos
License: MIT
Author: Christian Pederkoff
Requires-Python: >=3.9
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: dev
Requires-Dist: Pillow (>=10.0.1)
Requires-Dist: black (>=25.0) ; extra == "dev"
Requires-Dist: flake8 (>=5.0.4) ; extra == "dev"
Requires-Dist: isort (>=6.0) ; extra == "dev"
Requires-Dist: numpy (>=1.13)
Requires-Dist: numpy-stl (>=2.17)
Requires-Dist: pep8-naming (>=0.13.2) ; extra == "dev"
Requires-Dist: pytest (>=8.0) ; extra == "dev"
Project-URL: Bug Tracker, https://github.com/cpederkoff/stl-to-voxel/issues
Project-URL: Documentation, https://github.com/cpederkoff/stl-to-voxel/wiki
Project-URL: Repository, https://github.com/cpederkoff/stl-to-voxel
Description-Content-Type: text/markdown

# stl-to-voxel
Turn STL files into voxels, images, and videos
## Main Features
* Convert stl files into a voxel representation
* Output to (a series of) .pngs, .xyz, .svx
* Command line interface

## How to run
### Run in command line
```
pip install stl-to-voxel
stltovoxel input.stl output.png
```

### Generating a higher resolution
```bash
stltovoxel input.stl output.png --resolution 200
```

### Specifying voxel size
```bash
stltovoxel input.stl output.png --voxel-size .5
```

### Multiple materials
```bash
stltovoxel input1.stl input2.stl output.png --colors "red,green"
```
Hex color values are also supported
```bash
stltovoxel input1.stl input2.stl output.png --colors "#FF0000,#00FF00"
```

### Integrate into your code
```python3
import stltovoxel
stltovoxel.convert_file('input.stl', 'output.png')
```

### Run for development
```bash
cd stl-to-voxel
python3 -m stltovoxel input.stl output.png
```

### See help
```bash
$ stltovoxel
usage: stltovoxel [-h] [--pad PAD] [--no-parallel] [--colors COLORS] [--resolution RESOLUTION | 
   --resolution-xyz RESOLUTION RESOLUTION RESOLUTION | 
   --voxel-size VOXEL_SIZE | --voxel-size-xyz VOXEL_SIZE VOXEL_SIZE VOXEL_SIZE] input [input ...] output
```

### Run unit tests
```bash
cd stl-to-voxel
PYTHONPATH=./ python3 test/test_slice.py
```

<!--- https://commons.wikimedia.org/wiki/File:Stanford_Bunny.stl --->

The resolution is optional and defaults to 100.

### Example:
![alt text](https://github.com/cpederkoff/stl-to-voxel/raw/master/data/stanford_bunny.png "STL version of the stanford bunny")
![alt text](https://github.com/cpederkoff/stl-to-voxel/raw/master/data/stanford_bunny.gif "voxel version of the stanford bunny")
### Multi-color Example:
<p float="left">
  <img src="https://github.com/cpederkoff/stl-to-voxel/raw/master/data/traffic_cone_1.png" width="300" alt="STL version of the orange part of the model">
  <img src="https://github.com/cpederkoff/stl-to-voxel/raw/master/data/traffic_cone_2.png" width="300" alt="STL version of the white part of the model">
  <img src="https://github.com/cpederkoff/stl-to-voxel/raw/master/data/traffic_cone.gif" width="300" alt="voxel version of the traffic cone">
</p>

[Model credit](https://www.thingiverse.com/thing:21773)

### [Features a fast winding number based algorithm for polygon repair](https://github.com/cpederkoff/stl-to-voxel/wiki/Polygon-Repair-Method)

