discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

$100 Bounty for easy feature

LH
Les Hall
Fri, Dec 19, 2014 3:45 PM

Thank you very much!

Les

On Dec 19, 2014, at 9:42 AM, Torsten Paul Torsten.Paul@gmx.de wrote:

On 12/19/2014 04:30 PM, Les Hall wrote:

Torsten, where in the docs is the command line info?  or do i try —help or
something?  I’d really like to do this the command line way.

A (very short) explanation is there:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment#Constants

Another simple example:

mode = 0;

module part1() {
cube(20, center = true);
}

module part2() {
cylinder(r = 5, h = 21, center = true);
}

module assembly() {
difference() {
part1();
part2();
}
}

if (mode == 1) {
part1();
} else if (mode == 2) {
part2();
} else {
assembly();
}

Create a batch file (or shell script, or processing sketch, ...):

openscad -Dmode=0 -o all.stl params.scad
openscad -Dmode=1 -o part1.stl params.scad
openscad -Dmode=2 -o part2.stl params.scad

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Thank you very much! Les > On Dec 19, 2014, at 9:42 AM, Torsten Paul <Torsten.Paul@gmx.de> wrote: > > On 12/19/2014 04:30 PM, Les Hall wrote: >> Torsten, where in the docs is the command line info? or do i try —help or > > something? I’d really like to do this the command line way. > > A (very short) explanation is there: > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment#Constants > > Another simple example: > > mode = 0; > > module part1() { > cube(20, center = true); > } > > module part2() { > cylinder(r = 5, h = 21, center = true); > } > > module assembly() { > difference() { > part1(); > part2(); > } > } > > if (mode == 1) { > part1(); > } else if (mode == 2) { > part2(); > } else { > assembly(); > } > > Create a batch file (or shell script, or processing sketch, ...): > > openscad -Dmode=0 -o all.stl params.scad > openscad -Dmode=1 -o part1.stl params.scad > openscad -Dmode=2 -o part2.stl params.scad > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
T
tdeagan
Mon, Dec 22, 2014 5:22 AM

Okay, it's not a bounty attempt, but here is a Python script that will
execute a batch series of OpenSCAD command lines driven from a .csv file.
You can use it to generate a set of images, a set of .STLs or whatever
formats are now or future supported.

The .CSV would would like this:

for an OpenSCAD file like this:

on Debian, the command

would generate (and optionally execute if the -x was missing,) a series of
command lines like this:

Notes:


openscad_batch.py
------------------------CUT BELOW HERE -----------------------------------

-----------------------------CUT ABOVE
HERE-------------------------------------
openscad_batch.py http://forum.openscad.org/file/n10696/openscad_batch.py
Cheers,
--tim

--
View this message in context: http://forum.openscad.org/100-Bounty-for-easy-feature-tp10618p10696.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Okay, it's not a bounty attempt, but here is a Python script that will execute a batch series of OpenSCAD command lines driven from a .csv file. You can use it to generate a set of images, a set of .STLs or whatever formats are now or future supported. The .CSV would would like this: for an OpenSCAD file like this: on Debian, the command would generate (and optionally execute if the -x was missing,) a series of command lines like this: *Notes*: - it's Python 3 (sorry, but I've moved on. 3 is the future.) - it needs a recent version of OpenSCAD to be able to do things like render (see OpenSCAD docs <http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment> for a list of which command line switches each version of OpenSCAD supports. - call it with -h to get instructions (you can also read them in the source below - I've tested on Windows 8.1 and Debian 64 bit ----------------------------------------------------------------------------------------- openscad_batch.py ------------------------CUT BELOW HERE ----------------------------------- -----------------------------CUT ABOVE HERE------------------------------------- openscad_batch.py <http://forum.openscad.org/file/n10696/openscad_batch.py> Cheers, --tim -- View this message in context: http://forum.openscad.org/100-Bounty-for-easy-feature-tp10618p10696.html Sent from the OpenSCAD mailing list archive at Nabble.com.