![]() |
omdl
v0.9.6
OpenSCAD Mechanical Design Library
|
OpenSCAD specified a value to be either a number, a boolean, a string, a range, a vector or or the undefined value. See [OpenSCAD types]. What is called a vector in the OpenSCAD types documentation is refereed to as a list here in order to distinguish between sequential lists of general or compound-values and [Euclidean vectors] of numbers.
| type | description |
|---|---|
| boolean | a binary logic value (true or false) |
| number | a numerical value |
| string | an iterable sequence of of character values |
| list | an iterable sequential of arbitrary values |
| range | an arithmetic sequence |
| function | a function literal or variable containing functions |
| value | description |
|---|---|
| undef | a value with no definition |
| "" | a string with no characters, the empty string |
| [] | a list with no element-values, the empty list |
| nan | a numerical value which is not a number |
| inf | a numerical value which is infinite |
For convenience, the flowing naming conventions are used to reference common data types used within the library.
| name | description |
|---|---|
| value | any dataum that can be stored in OpenSCAD |
| scalar | a single non-iterable value |
| iterable | any value with iterable elements |
| empty | any iterable value with zero elements |
| bit | a binary numerical value (0 or 1) |
| integer | a positive, negative, or zero whole number |
| even | an even integer |
| odd | an odd integer |
| decimal | integer numbers with a fractional part |
| index | a list index sequence |
| datastruct | a defined data structure |
| data | an arbitrary data structure |
| map | data store of keys mapped to values |
| table | data store of values arranged in rows and columns |
When a list has an expected number of elements '-n', the expected number is appended. When there is a range of expected elements, the lower and upper bounds are separated by a ':' and appended. When the list elements values are of a specified data type, that type is added before the name. See the following tables for a few examples.
| name | description |
|---|---|
| list-n | a list of of n elements values |
| list-l:u | a list of l to u elements values |
| type-list | a list of elements with an expected type |
| type-list-n | a list of n elements with an expected type |