[OpenSCAD] batch processing commands

G. Wade Johnson gwadej at anomaly.org
Sat Sep 19 21:35:24 EDT 2015

On Sat, 19 Sep 2015 14:37:34 -0700 (MST)
ufomorace <ant.stewart at yahoo.com> wrote:

> I want to process a list of .scad files in a folder, and i didn't
> understand how to do it with command line, please could someone tell
> me the secret codes?

The simplest of commands for one file would be:

   openscad -o file.stl file.scad

You could repeat this using whatever looping construct is available in
your shell. (For windows, it's been so long I can't remember the
syntax.) For bash, you could do

for f in *.scad; do openscad -o ${f/scad/stl} $f; done

Personally, I use a Makefile with an appropriate rule for converting
any .scad file into a .stl.

%.stl: %.scad
	$(OPENSCAD) -o $@ $<

G. Wade
A development process that involves any amount of tedium will
eventually be done poorly or not at all.
                -- Matt Blodgett's First Law of Software Development

More information about the Discuss mailing list