
A $fn over 128 is not recommended or only for specific circumstances, and below 50 would be advisable for performance. Depending on the design, $fn values, and the corresponding results of $fa & $fs, should be kept small, at least until the design is finalised when it can be increased for the final result. The higher the number of fragments, the more memory and CPU consumed large values can bring many systems to their knees. Other two variables are ignored, and a full circle is rendered using this When this variable has a value greater than zero, the $fn is number of fragments and usually has the default value of 0. Attempting to set a lower value causes a warning. Theĭefault value is 2 so very small circles have a smaller number of fragments than specified using $fa. More fragments than 360 divided by this number. The $fa, $fs and $fn special variables control the number of facets used to Several special variables are already defined by OpenSCAD.

This is useful when multiple arguments need to be passed thru several layers of module calls. ECHO: " in show ", "regular global", " ", "special global" ECHO: " in show ", "regular global", " ", 6 ECHO: "in special loop ", "regular global", " ", 6 ECHO: " in show ", "regular global", " ", 5 ECHO: "in special loop ", "regular global", " ", 5 ECHO: " outside ", "regular global", " ", "special global"įor ( regular = ) Module show() echo(" in show ", regular," ", $special ) Įcho (" outside ", regular," ", $special ) This means that special variables can potentially have a different value each time a module or function is called. Special variables pass along their value from within the scopeįrom which the module or function is called. The value for a regular variable is assigned at compile time and is thus static for all calls. Modules and function see all outside variables in addition to those passed as arguments or defined internally.Ĭurrently valid special variable names can only be composed of $ followed by simple characters and underscores and do not allow high-ascii or unicode characters.

Special variables provide an alternate means of passing arguments to modules and functions.Īll user, or OpenSCAD, defined variables starting with a '$' are special variables, similar to special variables in lisp.
