1

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.

agarza
  • 1,734
  • 2
  • 16
  • 33
j0h
  • 113
  • 4

2 Answers2

2

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.

1

No. OpenSCAD is not a scripting language. You cannot use it to generate any kind of executable code. All that it does is to create static geometrical objects that can be exported as STL files (and other formats). If you want to do scripting, use a scripting language such as Python. Note that Python has some wrappers for OpenSCAD that may allow you to do what you want. For example, see OpenPySCAD.

Mick
  • 3,190
  • 1
  • 11
  • 21