0

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,334
  • 2
  • 10
  • 30
j0h
  • 103
  • 3
  • How is this being applied to 3D printing? I only ask to avoid your question being closed for not being [on-topic](https://3dprinting.stackexchange.com/help/on-topic). – agarza Dec 12 '21 at 01: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 '21 at 01:46

2 Answers2

1

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,002
  • 1
  • 9
  • 20