Quote Originally Posted by old man emu View Post
What is the meaning or function of:

1. the round brackets - Difference () Union ()
2. Wiggly brackets {lines of code}
3. stuff inside square brackets [ ]

I know that // indicates a coder's comment that does not get read when the code is run.
OpenScad evolved and was never really well thought out in advance. The syntax of the language shows that. They wanted it to look like C but the fundamentals of the language are different. OpenScad does not even allow variables to change value during 'execution'. The parts of the language where it looks like that is happening are not real. For example the 'for' loops. The compiler is just in-line compiling the code blocks with different values of the index 'variable'.

Probably, the round brackets on Difference() and Union() are just to denote that you are performing a 'function'. But that deviates from their usage in C where you are passing in parameters within the ().

The square brackets are more consistent. If you see square brackets [], the contents is going to be used as a vector (or a point).

OpenScad is a great tool. But IMHO it is an abomination from a syntax perspective. Just as people study different spoken languages to understand how one language or dialect evolved from another and influenced thought on this subject or that one... OpenScad provides a Computer Language equivalent. Somebody could write a PhD thesis on the subject.

The syntax is chaotic and a mess.... (But I do like OpenScad!!!!)