Thingiverse
OpenSCAD .csv driven batch exporter
door tdeagan
17
Downloads
16
Likes
0
Makes
here is a Python script that will execute a batch series of OpenSCAD command lines driven from a .csv file. You can use it to generate a set of images, a set of .STLs or whatever formats are now or future supported.
It uses OpenSCAD's -D capability to populate variables on the command line. Since OpenSCAD determines the output format from the extension of the output filename, that is driven from the .csv as well.
The .CSV would would like this:
FILE,ARGS,able, baker, charlie
"test1.png","--render --projection=o",10,20,30
"test2.stl",,20,30,40
"test3.stl",,30,40,50
for an OpenSCAD file like this:
able = 10;
baker= 10;
charlie = 10;
cube([able,baker,charlie]);
on Debian, the command
python3 openscad_batch.py -x params.csv test.scad
would generate (and optionally execute if the -x was missing,) a series of command lines like this:
* openscad --render --projection=o -D "baker=20" -D "able=10" -D "charlie=30" -o test1.png test.scad
* openscad
It uses OpenSCAD's -D capability to populate variables on the command line. Since OpenSCAD determines the output format from the extension of the output filename, that is driven from the .csv as well.
The .CSV would would like this:
FILE,ARGS,able, baker, charlie
"test1.png","--render --projection=o",10,20,30
"test2.stl",,20,30,40
"test3.stl",,30,40,50
for an OpenSCAD file like this:
able = 10;
baker= 10;
charlie = 10;
cube([able,baker,charlie]);
on Debian, the command
python3 openscad_batch.py -x params.csv test.scad
would generate (and optionally execute if the -x was missing,) a series of command lines like this:
* openscad --render --projection=o -D "baker=20" -D "able=10" -D "charlie=30" -o test1.png test.scad
* openscad
Heb je dit model geprint? Inloggen en deel je make!
Log in om een reactie achter te laten
InloggenNog geen reacties – wees de eerste!