411 REFERENCE · Wikibooks
OpenSCAD User Manual/Data Types Values Constants
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Values and Data Types
A value in OpenSCAD is either a Number (like 42), a Boolean (like true), a String (like "foo"), an Object, or the Undefined value (undef). Values can be stored in variables, passed as function arguments, and returned as function results. There are also a small number of constant values predefined by the language.
a Range (like [0: 1: 10]) is a syntactic construction that is almost an object in that its three values define a numeric range, it may be assigned to a variable or used as a literal constant. But it is not really a "value".
Previous to Version 2025.07.11 the only data structure in this language was the Vector (like [1,2,3]).
It can be used as an array or list with elements accessed by their indexed position
But vector elements are untyped OpenSCAD values so complex, nested structures are possible using vectors of vectors.
The terms "list" and "array" are the usual names for linear data structures that are accessed sequentially by index, but in OpenSCAD the term "vector" is used to reflect its 3D math roots and its greater versatility.
Object data structures have been introduced to the language recently. 2025.07.11.
Their elements may be accessed by index or by name, and if an lambda function is assigned to be an element's "value" then the object will have an executable methods.
The last language element that may be assigned to a variable as if it was a value is an un-named, or lambda, function.
OpenSCAD is a dynamically typed language with a fixed set of data types.
There are no named types, named objects are not assigned to a type, and there are no user defined types.
Index of Data Types
Numbers Numbers are the most important data type in OpenSCAD
Booleans True / False values used mainly in Flow of Control Statements
Characters and Strings Text elements are used when interacting with the user, but may also be the basis in models that need text elements.
Ranges almost a data type in that it is a syntactic short form for a sequence of numbers
Vectors the only data structure in OpenSCAD. Called "lists" or "arrays" interchangeably and implemented with some overlap with strings that allow some functions to work on both.
Objects containers for information that is accessed by name. Currently only returned from select built-in functions reading data from external files.
Lambdas un-named functions that may be defined for use in expressions and so be assigned to variables.
Related Issues There a number of topics related to the handling of variables and values that are fully presented in other sections:
The undefined result and other constants
Variables cannot be changed in a Functional Language
Special Variables affect run-time operations