A tool to convert STL files to VRML/WRL format
Project description
stl2wrl - Convert an STL file to VRML/WRL
Useful for converting basic STL objects to Virtual Reality Modeling Language (VRML/WRL) files in KiCAD, Outline3D (or other programs).
Recent Improvements
This version has been enhanced with:
- Full type annotations for all functions and methods
- Comprehensive English documentation for all functions and classes
- Improved error handling for file validation
- Support for both ASCII and binary STL files (with numpy-stl)
Dependencies
For working with binary STL files, you need to install the following dependencies:
- numpy
- numpy-stl
Installation
You can install them using pip:
pip install numpy numpy-stl
Or use the provided requirements.txt file:
pip install -r requirements.txt
Installing from Test PyPI
To install the package from Test PyPI, use the following command:
pip install --index-url https://test.pypi.org/simple/ stl2wrl
Python Version Compatibility
The numpy-stl library has different compatibility requirements based on your Python version:
- For Python < 3.9: numpy-stl version 2.11.0 to 3.1.2
- For Python >= 3.9: numpy-stl version 3.1.2 and above
For the K3 environment (Python 3.7 32-bit Windows only):
pip install numpy-stl==3.1.2 -U --target <UserProto>/site-packages
For ASCII STL files, no additional dependencies are required.
Performance Tests
Performance test results on a Windows 11 system with AMD Ryzen 7 5800H processor:
Small model (zynq_chip.stl - 0.01 scale):
- Time: 1.38 seconds
- Command:
python stl2wrl.py demo\zynq_chip.stl 0.01
Large model (440.stl - 1.0 scale):
- Size: >150 MB Due to the very large size of the model, the 440.stl file has not been added to the repository.
- Time: 18.17 seconds
- Command:
python stl2wrl.py demo/440.stl 1
Example using a CLG400 footprint:
# 2.54 Scaling factor for mm/inch conversion
# Output is stored in demos/zynq_chip.wrl, ready to import into KiCAD
# Conversion may take ~30 seconds or longer for this model (Spec'd on M1 Macbook Air)
./stl2wrl.py demos/zynq_chip.stl 2.54
KiCAD import
Test model 440
Contributors
- Original implementation by Bradley Boccuzzi
- Improvements by Alexander Dragunkin and SOURCECRAFT CODE assistant
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stl2wrl-1.1.0.tar.gz.
File metadata
- Download URL: stl2wrl-1.1.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e0fbd0bad1dcb1e910fd02ab86ee8188f235203c988a5f88f220d85d6dbc3f2
|
|
| MD5 |
e3a3203b151bfcca071372c0365a52d2
|
|
| BLAKE2b-256 |
586f5c5e430ca70c46364786b5a34ecff5717869fa1d4f087ccd4a1a3a3f14a3
|
File details
Details for the file stl2wrl-1.1.0-py3-none-any.whl.
File metadata
- Download URL: stl2wrl-1.1.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98b5295f6609e95e7b79f9763d1e10413ad87bf273df718cad1a8ee34eaca7f5
|
|
| MD5 |
1536fdadf605d4fbd2459a036540875f
|
|
| BLAKE2b-256 |
a5a1d9b46447db4f0c8bd5c8f518e393434f045f5c505e366989de50bd0c4f8c
|