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

See help

$ 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

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

Features a fast winding number based algorithm for polygon repair

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.10.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stl_to_voxel-0.10.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file stl_to_voxel-0.10.1.tar.gz.

File metadata

  • Download URL: stl_to_voxel-0.10.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1012-azure

File hashes

Hashes for stl_to_voxel-0.10.1.tar.gz
Algorithm Hash digest
SHA256 15fb7b4a7e09b93b0052d995b94e2e2565e309603675d308ed1aee9f70d8c30c
MD5 5833b4318503ce1e06e2bcce73c1966e
BLAKE2b-256 dc55af0fabf1b889239a8bf837e27298ad988f83996e41d47d9f5457f37fcb67

See more details on using hashes here.

File details

Details for the file stl_to_voxel-0.10.1-py3-none-any.whl.

File metadata

  • Download URL: stl_to_voxel-0.10.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.11.0-1012-azure

File hashes

Hashes for stl_to_voxel-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6959c00ee5c49eb8fe32d1206dc3733d9460885aee319045d78969556514878b
MD5 7fd50773a1bd1682ebc6bafbf5d01158
BLAKE2b-256 58e62ac61d7c2f61f49f7cd77e68acda40f0a761dd5c0a0722a2aacfddf25174

See more details on using hashes here.

Supported by

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