0
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ How is this being applied to 3D printing? I only ask to avoid your question being closed for not being on-topic. $\endgroup$
    – agarza
    Dec 12, 2021 at 1:41
  • $\begingroup$ 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. $\endgroup$
    – j0h
    Dec 12, 2021 at 1:46

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .