Closed jgrizou closed 7 years ago
Might be a good to have globally in the overall settings - will consider it (in openscad.js, but not sure if it can make it into csg.js as well).
I have a quick reference started at http://www.z3d.jp/wiki/doku.php?id=en:resources:openjscad Let me know if you want to add to this.
My preference is to make the "resolution" into a parameter for the design. That allows people to render both low and high resolution output. And some browsers (Safari / Chrome) are not capable of high resolution rendering.
Yes users should have the choice to output arbitray resolution, ideally in the parameter definition box. To give an example, I like that in this project: http://builder.mobilityshield.com/ users can select between low, medium, and high quality for the parts. The respective resolution being ["8","16","32"]. But to do so the guy had to add the resolution paramter in all of its primitives, see https://github.com/mobilityshield/OpenJsCAD-Parts/blob/master/plates-strips.jscad. Which I found annoying.
@z3dev: why would Safari and Chrome not capable of high resolution? For me resolution is a continum (see $fn variable in OpenScad), what would be the limit for $fn each browsers?
Thanks for the information. I like the idea of low, medium, and high quality as that is easy for normal people to understand. But CSG.js only understands numbers.
The "resolution" applies to the number of slices in cylinders, and number of steps in creating arcs (and 3D spheres). So, a low resolution (lets say 12) creates far fewer vertices and faces. As the resolution is increases, the number of vertices and faces increase rapidly.
Safari and Chrome have limitations in the JavaScript stack size. Scripts can easily over run this. If you hit these limits then I suggest moving to Firefox.
As for passing parameters, I suggesting using "attributes" on a single parameter. That's how the parameters are passed into the scripts. Typically, I just add attributes to that same variable, and pass that through to other routines.
This issue was moved to jscad/scad-api#15
In OpenScad, we can change the global $fn variable to generate more or less detailled STL files.