Documentation / Node reference / code nodes
code/SDFMenger
The distance to a Menger sponge.
Sdf3d
Returns the signed distance from a sampled position to a Menger sponge: a cube with a square hole bored through the middle of each face, then the same holes at a third of the size through each of the smaller cubes left, as many times as `iterations` says. The twin of geo/SDFMenger, for use inside a geo/SDFBuilder sub-network.
Parameters
| Name | Type | What it does |
|---|---|---|
| P | Vector3 | Position to sample the field at. Left unwired it reads the builder's own sample position. |
| t | Vector3 | Center of the sponge. |
| size | Float | Edge length of the cube the sponge is carved from. |
| iterations | UInt8 | How many levels of holes are carved. 0 is the plain cube. A wired value is capped at 10, where the holes are far smaller than a pixel. |
See also
- geo/SDFMenger
- code/SDFBox
- code/SDFRepeat
- code/SDFBoolean
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.