https://github.com/nliaudat/stl2openscad
Some python scripts to decompose stl to openscad primitives
https://github.com/nliaudat/stl2openscad
converter openscad primitives stl voxel
Last synced: 2 months ago
JSON representation
Some python scripts to decompose stl to openscad primitives
- Host: GitHub
- URL: https://github.com/nliaudat/stl2openscad
- Owner: nliaudat
- License: mit
- Created: 2025-07-02T16:01:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-04T18:23:10.000Z (3 months ago)
- Last Synced: 2025-07-17T21:11:23.883Z (3 months ago)
- Topics: converter, openscad, primitives, stl, voxel
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# STILL BETA : stl2openscad
Some python scripts to decompose stl to openscad primitives# STL to OpenSCAD Voxel Converter
A Python script that converts STL 3D models into OpenSCAD code using voxelization and greedy merging, with optional debug coloring.
## Features
- Converts STL files to OpenSCAD cube structures
- Adjustable voxel resolution
- Greedy merging algorithm reduces cube count
- Progress bars for voxelization and merging
- Debug mode with random colors for visualization
- Handles large files efficiently## Installation
1. Clone this repository:
```
git clone https://github.com/yourusername/stl2openscad.git
cd stl2openscad
```2. Install dependencies:
```
pip install -r requirements.txt
```3. Usage
```
python stl2openscad.py input.stl output.scad --resolution 1.0 --debug
```3.1 Parameters
-r, --resolution : (Voxel size in mm, default = 1.0)
--debug : Enable colored debug mode (default False)## Third-party components and their licenses:
1. Drububu's Voxelizer techniques - MIT License
2. PyVista voxelization methods - MIT License
3. CuPy GPU acceleration - MIT License
4. PyOpenCL implementation - Apache License 2.0# STL to OpenSCAD Polyhedrons Converter
Very fast :)
```
stl2scad_polyhedrons.py source.stl output.scad
```