With 3S scripts you define functions for later use in Selective Space Structures to be performed when a structure is applied to a part, or on a case-by-case basis.
Lua in 3S
The programming language is based on the Lua script language. Refer to the official manual for more information about the Lua script language (www.lua.org/manual/5.0). The scripting reference for 3S is part of the Netfabb Lua API reference.
Lua cheat sheet
Lua objects |
Methods are accessed with a colon. object:method(...); Properties are accessed with period. object.property; |
Variables |
Values are assigned to variable with a single equals sign.
Variable = ValueThis defines and initializes the variable. For many operations, you can choose any name as variable and assign elements of 3S to that name. For example: cell=structure:findcell("cell1"); In this example, the cell with the name cell1 in the 3S Generator is from now on referred to as cell in the script. For some methods, you can add the Boolean value true or false. |
Relational operators |
|
Arithmetic operators |
|
Conditional branching |
|