Skip to main content

Turn STL files into voxels, images, and videos

Project description

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

stltovoxel input.stl output.png --resolution 200

Specifying voxel size

stltovoxel input.stl output.png --voxel-size .5

Multiple materials

stltovoxel input1.stl input2.stl output.png --colors "red,green"

Hex color values are also supported

stltovoxel input1.stl input2.stl output.png --colors "#FF0000,#00FF00"

Integrate into your code

import stltovoxel
stltovoxel.convert_file('input.stl', 'output.png')

Run for development

cd stl-to-voxel
python3 -m stltovoxel input.stl output.png

Run unit tests

cd stl-to-voxel
PYTHONPATH=./ python3 test/test_slice.py

The resolution is optional and defaults to 100.

Example:

alt text alt text

Multi-color Example:

STL version of the orange part of the model STL version of the white part of the model voxel version of the traffic cone

Model credit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stl_to_voxel-0.9.3.tar.gz (7.7 kB view hashes)

Uploaded Source

Built Distribution

stl_to_voxel-0.9.3-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page