ShapeJS Feature Proposal: OpenSCAD Parametric Model Support

Discussion in 'ShapeJS' started by 848112_deleted, Mar 23, 2016.

  1. I would like Shapeways to provide a mechanism for running a parametric OpenSCAD script on their servers from ShapeJS with the output being pulled into ShapeJS for further manipulation.

    Having uploaded an OpenSCAD script to the Shapeways server (assuming appropriate security, etc.), then in ShapeJS I would like to be able to code something like:

    var openSCADParam = {thickness:3, radius:50};
    distData = createModelDistanceOpenSCAD("mug.scad",openSCADParam,0.5*MM,100*MM);

    In the background OpenSCAD would be run with parameters being passed to the script via variables:

    openscad -o mug.stl -D thickness="3" -D radius="50" mug.scad

    ADVANTAGES
    1) It provides a gentle transition route for existing OpenSCAD code and programmers.
    2) It avoids forcing designers to choose between OpenSCAD & ShapeJS. They can choose to code in OpenSCAD and then write a minimal ShapeJS UI.
    3) It provides ShapeJS with an optional boundary representation front end that is then complimented by ShapeJS's unique functional representation capabilities.
    4) It could provide easy access to the exisiting large collection of public domain parametric OpenSCAD scripts for non-programmers, e.g. the best of parametric OpenSCAD on Thingiverse could be provided on Shapeways with easy to use UIs for non-programmers.

    ISSUES
    1) OpenSCAD rendering can be very slow, so the real time nature of the ShapeJS UI may be impaired.
    2) Added complexity through indirectly supporting an extra design language.

    What do you think?

    Thanks.
     
  2. neon22
    neon22 Member
    This would be a great idea. The ability to use current OpenSCAD dynamic srcipts to make paramaterized objects would be excellent.
    E.g. What the customizer on Thingiverse offers but with all of Shapeways's excellent material choices and direct ordering capability.

    In case you're wondering how to prevent users from making objects that can't be printed (by choosing parameter spaces which are not viable)
    - the maker could supply a set of pre-identified 'common' scenarios which could be printed and photographed.

    The user could then choose one of these - knowing it will succeed, or tweak the settings knowing that there is some risk involved.
    or the model could always go through Shapeways's system to validate it before printing as well...

    E.g. items like these (mine)
    - http://www.thingiverse.com/thing:923244
    - http://www.thingiverse.com/thing:1015874
    - http://www.thingiverse.com/thing:1433790