Bulk-export OpenSCAD models from CSV or customizer JSON parameter sets.
Project description
openscad-exporter
Bulk-export OpenSCAD models from CSV or customizer JSON parameter sets.
Requirements
Requires an OpenSCAD binary that supports --export-format param
(OpenSCAD 2021.01 development snapshots or the 2024.xx stable release and later).
Install
uv sync
Usage
# Generate a single-row CSV of a SCAD file's default parameter values.
uv run openscad-exporter scad-to-csv path/to/model.scad --output params.csv
# Convert a CSV (one parameter set per row, with an `exported_filename` column)
# into an OpenSCAD customizer JSON file.
uv run openscad-exporter csv-to-json params.csv --scad path/to/model.scad --output model.json
# Export every parameter set to STL (or off/amf/3mf/dxf/svg/png).
uv run openscad-exporter export path/to/model.scad --from-csv params.csv --output-dir out
uv run openscad-exporter export path/to/model.scad --from-json model.json --output-dir out --format stl
PNG-specific camera flags (--camera, --imgsize, --colorscheme, --viewall, --render)
only apply with --format png.
OpenSCAD binary is discovered via --openscad-path, $OPENSCAD_BINARY, PATH, then known
platform locations.
Examples
These examples use tests/fixtures/rocket.scad, a small parametric rocket with the customizer
parameters rocket_d, rocket_h, head_d, head_h, wing_w, many, wing_l, wing_h, and
$fn.
Minimal CSV
Only the exported_filename column is required. Any parameter you leave out keeps its default
value from the .scad file.
exported_filename,rocket_h
short,60
tall,150
Export both variants to STL:
uv run openscad-exporter export tests/fixtures/rocket.scad \
--from-csv rockets.csv --output-dir out --format stl
You'll get out/short.stl and out/tall.stl.
Multi-parameter CSV
Override several parameters per row:
exported_filename,rocket_d,rocket_h,head_d,wing_w,many
slim,20,120,30,2,3
classic,30,100,40,2,3
chunky,50,80,60,3,4
Nested directory layout
Slashes in exported_filename create subdirectories under --output-dir:
exported_filename,rocket_h
small/v1,60
small/v2,80
large/v1,150
uv run openscad-exporter export tests/fixtures/rocket.scad \
--from-csv rockets.csv --output-dir out --format stl
Produces:
out/
├── large/v1.stl
└── small/
├── v1.stl
└── v2.stl
PNG previews
Render each row as a 512×512 PNG with the auto-fit camera:
uv run openscad-exporter export tests/fixtures/rocket.scad \
--from-csv rockets.csv --output-dir previews \
--format png --viewall --imgsize 512,512
Discovering parameters
If you don't yet have a CSV, dump the SCAD file's defaults to seed one:
uv run openscad-exporter scad-to-csv tests/fixtures/rocket.scad --output rockets.csv
This writes a single default row with every customizer parameter as a column. Duplicate it,
edit the values, and re-run export.
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 openscad_exporter-0.1.0.tar.gz.
File metadata
- Download URL: openscad_exporter-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
248061a38770ebc4550ddc8ae5b8b71b09567cb3d789aa0d9486d70911bc6064
|
|
| MD5 |
83cdb38af2e5b27cb36b3de3d44a0992
|
|
| BLAKE2b-256 |
04243f24d509a92ee1394486d34a32cfe5afebbc3e8e7ea835c17b3f83a90891
|
Provenance
The following attestation bundles were made for openscad_exporter-0.1.0.tar.gz:
Publisher:
pypi.yml on digitalresistor/openscad-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openscad_exporter-0.1.0.tar.gz -
Subject digest:
248061a38770ebc4550ddc8ae5b8b71b09567cb3d789aa0d9486d70911bc6064 - Sigstore transparency entry: 1555160733
- Sigstore integration time:
-
Permalink:
digitalresistor/openscad-exporter@e20489081ed59fb6b1993102e650aa11549b1cf4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/digitalresistor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@e20489081ed59fb6b1993102e650aa11549b1cf4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openscad_exporter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openscad_exporter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f035669e348b50e762127acff284d7f0017fdba7c7e2625771f0926ea16b6d23
|
|
| MD5 |
901ea36d5114ec0bb390e01800d300f3
|
|
| BLAKE2b-256 |
0fbd4a39bf8477413d9d465f7875e908f9f05a103bb586df0508da9e2d55e20d
|
Provenance
The following attestation bundles were made for openscad_exporter-0.1.0-py3-none-any.whl:
Publisher:
pypi.yml on digitalresistor/openscad-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openscad_exporter-0.1.0-py3-none-any.whl -
Subject digest:
f035669e348b50e762127acff284d7f0017fdba7c7e2625771f0926ea16b6d23 - Sigstore transparency entry: 1555160735
- Sigstore integration time:
-
Permalink:
digitalresistor/openscad-exporter@e20489081ed59fb6b1993102e650aa11549b1cf4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/digitalresistor
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@e20489081ed59fb6b1993102e650aa11549b1cf4 -
Trigger Event:
push
-
Statement type: