OpenJSCAD.org icon indicating copy to clipboard operation
OpenJSCAD.org copied to clipboard

possible to use interactive params examples to generate multiple models with openjscad CLI?

Open jtoy opened this issue 8 years ago • 9 comments

In the examples directory you have files that have interactive parameters like the gear: https://github.com/jscad/OpenJSCAD.org/blob/master/examples/gear.jscad Can that same file be run with the CLI somehow so I can generate multiple stl files like: openjscad gear.jscad -paramaters numberTeeth=[5,10] -output_folder gears_folder

where that would generate STLs with the number of teeth set to 5 and 10?

jtoy avatar Dec 09 '17 17:12 jtoy

@jtoy right now, only a single output per CLI call is possible but

  • multiple outputs has been discussed previously : https://github.com/jscad/OpenJSCAD.org/issues/282
  • parameters can be provided like this : https://github.com/jscad/OpenJSCAD.org/blob/master/src/cli/cli.test.js#L45
  • for V2.0 multiple outputs for CLI is 100% going to be in there

kaosat-dev avatar Dec 09 '17 22:12 kaosat-dev

I have to write a script to do this for my project now, so I can try to write my own version now and submit it as a patch. @kaosat-dev do you have any idea on when v2 will be released?

jtoy avatar Dec 21 '17 21:12 jtoy

@jtoy that would be great ! Even if it is nothing fancy, an addition like this would be good, and I have a ton of other things to work on. We can help out if needed ! :) For V2 : hard to give a precise date, but I am hoping somewhere around end of January 2018 at best

kaosat-dev avatar Dec 22 '17 20:12 kaosat-dev

@kaosat-dev here is a script I wrote to generate multiple versions from interactive param examples: https://github.com/jtoy/cad_model_experiments/blob/master/multijscad.js I can add as a pull request if you think helpful.

jtoy avatar Dec 26 '17 17:12 jtoy

@jtoy I will take a look at the script tomorrow thanks !

kaosat-dev avatar Dec 26 '17 21:12 kaosat-dev

@kaosat-dev I just updated the code to be a little simpler: https://github.com/jtoy/cad_model_experiments Should I submit a pull request to add this?

jtoy avatar Dec 29 '17 16:12 jtoy

@jtoy I like it. Why the interest in the gears? FYI, there's a website that generates gears which is based on JSCAD; http://www.knowhave.com/gear/worm.php

I just have one comment about the design (not the code). It does have an interactive parameter for 'resolution'. Designs need to be high definition when generating smooth curves.

z3dev avatar Dec 30 '17 00:12 z3dev

@z3dev Great, I will submit a pull request. I just use gears as an example as I pulled it from the OpenJSCAD examples: https://github.com/jscad/OpenJSCAD.org/blob/master/examples/gear.jscad I am generating many other types of objects.

jtoy avatar Dec 30 '17 01:12 jtoy

@z3dev @kaosat-dev here is the pull request: https://github.com/jscad/OpenJSCAD.org/pull/338

jtoy avatar Dec 30 '17 16:12 jtoy

@jtoy please open a new issue against V2 if you still want this functionality. And of course, you are welcome to submit a pull request. :)

z3dev avatar Aug 13 '22 11:08 z3dev