[OpenSCAD] ClikScad - create OpenSCAD models without all the typing

Doug Moen doug at moens.org
Fri Oct 25 09:33:13 EDT 2019

@nophead: Using text is a major benefit of OpenSCAD because it can be pasted into emails and checked into source control. It is also fairly concise. I imagine the graphical representation of my typical designs would be an enormous tree.

All this is true; text is important.

@nophead: Do people really struggle much with syntax?

Yes, some people do really struggle with syntax. The Elm community calls this "the syntax cliff": "How many people fall off the syntax cliff and give up on a language or just quit programming entirely?". https://elm-lang.org/news/the-syntax-cliff

As a professional software engineer, I can memorize large amounts of programming language syntax. It's a skill not everyone has, just as a concert pianist can sight read music notation while playing the piano in real time with all 10 fingers (I can't do that).

I know that OpenSCAD is a "CAD" program, but I got into it in order to make art. In the 3D computer graphics business, the most popular interface for programming languages aimed at artists is "node and wire" syntax. For example, Blender has this.

I'm not claiming that node+wire is the "best" graphical syntax. However, here are the benefits:
* You don't have to memorize module names. You can select a module from
 a hierarchical menu, or find a module using keyword search,
 and then a node is created which calls the module.
* You don't need to memorize module parameters.
 The parameters are all laid out for you in the node.
* You can continuously tweak numeric parameters using a slider.
 You can use a colour picker to tweak a colour parameter.

For me, the ability to tweak module parameters using a slider and get real time feedback in the preview window is a game changer. It makes me much productive in certain tasks. For other people, not having to memorize syntax is the key feature.

There are ways to combine the benefits of text syntax with the benefits I listed of the node+wire syntax. A "projectional editor" represents the program in memory, not as a character string, but as a syntax tree. As you edit the program, the syntax tree is modified, and the syntax tree is "projected" onto the display, possibly as text, or possibly using a graphical syntax, such as node+wire, or like BlocksCad. There are lots of text-based IDEs for conventional programming languages, which use this approach to provide assistance to the user, such as tab-completion of identifiers, auto-fill-in of function argument lists, and even sliders for tweaking numeric parameters. The GlslEditor supports sliders for live editing of GLSL shader programs (GLSL has a C-like text syntax).

What I think would be really cool is a projectional editor that lets you switch back and forth between text syntax and graphical syntax. I'm looking around to see if someone has implemented this idea already.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20191025/8336d756/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 297637 bytes
Desc: not available
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20191025/8336d756/attachment.png>

More information about the Discuss mailing list