# Is shell scripting possible with OpenSCAD?

I literally just started OpenSCAD today, so please take it easy on me, but is shell scripting possible with OpenSCAD? as in, to write a script in the OpenSCAD syntax, and have it output images, or animations? with or without having to render the image.

I've been reading the man pages, and I'm not sure if that can be done.

• How is this being applied to 3D printing? I only ask to avoid your question being closed for not being on-topic. Dec 12, 2021 at 1:41
• can it simply be in relation to 3d modeling? or is that too far removed? I mean animation can show me how a model works, so maybe I don't have to waste time modeling mechanisms that wont work if they're printed.
– j0h
Dec 12, 2021 at 1:46

You can invoke OpenSCAD from the command line, and have it output image renderings or STL files. The -D command line option lets you pass variable definitions/overrides (or arbitrary scad code fragments) in, which can be used to animate or otherwise. And, like any command line too, you can invoke it from a shell script, although using a makefile tends to be a better option.