Sharing: how to render on command line

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sharing: how to render on command line

jdawgaz
To keep working in openscad and rendering at the same time is easy, with a little bit of openscad command line know how.

Here is my render script: (runs on linux and os x)
Sorry windows people, I have no windows computer to write a script for you.
But I am sure something could be whipped up there.

#!/usr/bin/env bash

if [ -z $1 ]; then
    echo "usage: render <file>.scad"
    exit 1
fi

of=${1%scad}stl     # substitute <inputfile>.scad with <inputfile>.stl

echo openscad -o $of $1
openscad -o $of $1


------------
Jerry

--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov

If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime. 
- Anonymous

If writing good code requires very little comments, then writing really excellent code requires no comments at all!
- Ken Thompson


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Sharing: how to render on command line

MichaelAtOz
Administrator
What would be handy for this approach, would be the ability to initiate a script from the OpenSCAD GUI.
Say F7, with the script command line in preferences with a substitute parameter of the scad filename.

Would need to make sure you saved changes of course.
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!