Documentation / Node reference / geo nodes
geo/QRCode
Creates a QR code as a flat 2D shape.
Primitives
Encodes 'text' as a QR code and builds its dark modules as one Manifold 2D cross section in the XY plane, the same plane flat text and geo/M2DPlane use. The code and its quiet zone always fill the unit square from (0, 0) to (1, 1), whatever the version, so place and size it with a geo/Transform. This is the same layout as tex/QRCode, so the texture on a unit plane lines up with the geometry. Touching modules are merged into larger shapes, so geo/M2DExtrude turns the code into a clean solid and geo/M3DBoolean can cut it out of another one. That is how a code is inlaid into the underside of a print, where it has to be mirrored to read from below.
The smallest code that holds the text is chosen. Text made only of digits, or only of uppercase letters, digits and the characters space $ % * + - . / :, is encoded in the denser modes, so an uppercase URL comes out smaller than the same URL in lowercase. Scheme and domain do not care about case.
The quiet zone is the light margin scanners need around a code, 4 modules wide by the standard. 'quietZone' reserves it inside the unit square. With 'fill' at DARK it is empty space, so a unit square base under the code has the right margin. With 'fill' at LIGHT it is part of the shape: the light modules and the margin make one plate with the dark modules as holes, for a code printed in two colours.
The object carries two attributes. QR_CODE_VERSION is the QR version the encoder picked, from 1 to 40. QR_CODE_MODULES_PER_SIDE is how many modules (the squares a code is made of) run along each edge of the code: version * 4 + 17. QR_CODE_MODULE_SIZE is the width of one module in the unit square, 1 / (QR_CODE_MODULES_PER_SIDE + 2 * quietZone), which is what a minimum print size is worked out from.
Parameters
| Name | Type | What it does |
|---|---|---|
| text | String | The text to encode, often a URL. Uppercase letters and digits make a smaller code than lowercase. |
| errorCorrection | UInt8 LOW · MEDIUM · QUARTILE · HIGH | How much of the code can be lost and still scan: LOW about 7%, MEDIUM 15%, QUARTILE 25%, HIGH 30%. More costs modules. |
| quietZone | UInt32 | Width of the light margin around the code, in modules. It is part of the unit square, so a larger margin makes the modules smaller. Scanners expect 4. |
| fill | UInt8 DARK · LIGHT | Which modules become the shape. DARK builds the dark modules, for an inlay or a cut. LIGHT builds the light modules and the quiet zone as one plate with the dark modules as holes. |
| inset | Float | Shrinks every solid area by this fraction of a module on each side. It makes up for a first print layer that spreads. Must stay under 0.5, where a lone module vanishes. |
See also
This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.