@uuon-foundation/menger-studio-engine
v1.0.0
Published
Parametric Menger sponge art engine with tunable carve rules, seeded stochastic pruning, and multi-format 3D export. Skin and perimeter layer of the clouud biological architecture.
Maintainers
Readme
Menger Studio Engine
UUON Foundation Inc. — Phillip Aguilar Ruiz III
License: USAL-1.0 · Version: 1.0.0

Live: https://uuon-foundation.github.io/menger-studio-engine/
UUho
The Menger sponge is one of the most studied objects in fractal geometry. Karl Menger described it in 1926 as a universal curve — a structure that contains a topological copy of every curve that can be drawn in three-dimensional space. Not a metaphor. Literally every curve. The Menger sponge at infinite depth contains all of them.
What makes it unusual is what it does to dimension. At depth 3 this engine renders 160 cubes. At infinite depth the object has zero volume and infinite surface area. It occupies a fractal dimension of approximately 2.727 — more than a surface, less than a solid. It lives between dimensions. No object you encounter in daily life does this. The Menger sponge is not a simplified version of something real — it is the real version of something most geometry cannot express.
The engine renders it in real time. Depth 1, 2, or 3. Three carve rules that produce topologically distinct structures from the same algorithm. Stochastic pruning with a seed parameter that makes every irregular variant fully reproducible. Four shade modes. Animated point lights. Export to OBJ, STL, and JSON from the same geometry the renderer is using — not a separate code path.
This is an art engine. The outputs are 3D assets. The parameters are a score.
UUhat
The Menger sponge is built by a single recursive rule: divide a cube into 27 sub-cubes arranged in a 3×3×3 grid, remove the ones where two or more axes pass through the center, repeat on every remaining cube. At depth 1 you have 20 cubes. At depth 2 you have 400. At depth 3 you have 8,000 — except this engine applies gap compression, so the visual count is lower and the structure reads clearly at every depth.
What makes this engine's version different from a standard Menger generator is the carve rule is not fixed. Three modes:
STANDARD ≥2 — the classic Menger sponge. Remove any sub-cube where at least two of its three axes pass through the center column. This produces the canonical holed structure — six square tunnels through the cube, one in each face direction.
OPEN SHELL ≥1 — remove any sub-cube where even one axis passes through center. This maximizes porosity. The result is a thin edge lattice — only the corner-connected edges survive. The cube becomes almost entirely open space held together at its geometric skeleton.
CORNER CAGE ≥3 — remove only the face-center sub-cube where all three axes meet. This minimizes porosity. Only the very center of each face is hollow. The structure is nearly solid, with one tunnel per face instead of the six of the standard mode.
On top of the carve rule, a stochastic pruner removes cells by probability using a seeded random number generator. The seed is a P-parameter. The same seed always produces the same irregular variant. This makes chaos reproducible — a specific skip pattern at a specific seed is a named, citable, exportable artifact.
UUhere
As an art engine: the browser. Visit the live URL, adjust parameters, export geometry. OBJ full mesh exports every cube as closed solid geometry. OBJ surface exports only the exterior-facing faces — no internal geometry, no wasted triangles, ready for rendering or 3D printing. Binary STL exports the same surface mesh in a format any slicer or fabrication pipeline reads directly. JSON config exports the full parameter set so any variation can be reconstructed exactly.
As an API endpoint on uuon.world:
POST https://uuon.world/apis/menger-studio/encode
POST https://uuon.world/apis/menger-studio/surface
GET https://uuon.world/apis/menger-studio/export/obj
GET https://uuon.world/apis/menger-studio/export/stl
POST https://uuon.world/apis/menger-studio/state
GET https://uuon.world/apis/menger-studio/statesFull API specification: api/README.md
As a live app on uuon.world:
https://uuon.world/apps/menger-studioAs an npm package:
npm install @uuon-foundation/menger-studio-engineAs an internal clouud engine: wired into uuon-clouud as a service callable by other engines in the biological architecture. The Menger surface mesh is the boundary layer other engines route signals through. See the clouud role below.
UUhen
The Menger sponge has been a mathematical object since 1926. As a real-time
parameterized art engine with seeded stochastic pruning, multi-format export,
and a grid-coordinate surface extractor that is correct across mixed recursion
depths — this specific implementation is original to UUON Foundation Inc., 2025,
documented as prior art in docs/ACADEMIC-RECORD.md
with a UTC timestamp at v1.0.0.
The engine is stable at v1.0.0. The API server is in progress. The clouud integration is the next session starting point.
UUhy
Because boundaries matter.
Every biological system that works has a skin. Not a metaphor — a literal selective permeability membrane that determines what passes in and what passes out. The circulatory system moves resources. The nervous system routes signals. The immune system identifies threats. None of them function without a boundary layer that controls access.
The Menger sponge is that boundary mathematically formalized. Its fractal dimension
sits between surface and solid because a boundary is not fully either one. The
holeRule parameter is a porosity dial: ≥1 is almost entirely permeable, ≥3 is
almost entirely closed. The skip and seed parameters introduce irregular porosity —
the biological skin is not uniform, and this engine can produce non-uniform
boundaries with full reproducibility from a six-number seed.
In the clouud biological architecture this engine fills the Skin / Perimeter Layer role. That position was listed as missing before this engine was built. It is now filled.
The Menger sponge is also one of the most visually compelling objects in mathematics. The recursive self-similarity reads as depth and intelligence. The tunnels through every face at every scale create a structure that looks like it was grown rather than constructed. The edge glow shader makes the fractal dimension visible — the boundary between solid and void pulses.
That is why.
clouud Biological Role
Biological function: Skin / Perimeter Layer — engine 10 of 10.
clouud is a computational system modeled on biological architecture. Each engine fills a structural role. The Menger Studio Engine fills the boundary function — the role a skin or perimeter membrane plays in any living system.
As an internal API (clouud-to-engine):
Other engines in the clouud architecture call the MSE API to generate boundary geometry. The Propagation Engine (proprioception) can use the Menger surface mesh as a domain over which to model state propagation — signals moving through a fractal boundary rather than a flat grid. The Boundary State Engine (decision layer) can use the holeRule parameter as a porosity gate — adjusting boundary permeability in response to entropy readings.
clouud → POST /apis/menger-studio/surface → boundary mesh → Propagation Engine
clouud → POST /apis/menger-studio/encode → cell array → BSE entropy analysisAs an external API (public):
Any developer can call the MSE API to generate Menger geometry without running a browser. POST a P-vector, receive a surface mesh or export file. The compression ratio means a 48-byte request returns up to 500KB of geometry — a 10,000:1 expansion that is fully deterministic from the input parameters.
Position in the architecture:
| Role | Engine | Status | |---|---|---| | Spine / CNS | uuon-clouud routing | Live | | Immune system | USAL-1.0 + gitleaks | Live | | Skeleton | Wave Field 3D Engine | Live | | Proprioception | Propagation Engine | Built | | Visual cortex | Recursive Fractal Engine | Live | | Decision layer | Boundary State Engine | Built | | Deep geometry | Kleinian IFS Engine | Built | | Vascular branching | Pythagorean Graph Engine | Live | | Prefrontal cortex | pscience Engine | In progress | | Skin / Perimeter | Menger Studio Engine | v1.0.0 |
F=(P,E,M,R,C)
| Symbol | Name | Definition | This Engine |
|---|---|---|---|
| P | Parameters | Minimal seed | { depth, rootSize, gap, holeRule, skipPct, skipSeed } — 6 values, ~48 bytes |
| E | Encoding | Deterministic function mapping P to structure | MSE_carve() — recursive 3³ subdivision with holeRule predicate and seeded pruner |
| M | Mapping | Translation from structure to renderable representation | MSE_gridSurf() — grid-coordinate adjacency → exterior face list |
| R | Representation | Any rendered output format | WebGL live · OBJ full · OBJ surface · Binary STL · JSON config |
| C | Compression | Ratio of R size to P size | P=48B → R≈500KB (depth=3 surface) → C≈10,000:1 |
Carve Modes
| holeRule | Name | Behavior | Fractal Character | |---|---|---|---| | 1 | Open Shell | Remove if ≥1 axis at center | Maximum porosity — edge lattice only | | 2 | Standard | Remove if ≥2 axes at center | Classic Menger — six-directional tunneling | | 3 | Corner Cage | Remove if all 3 axes at center | Minimum porosity — face-center void only |
Compression
| Configuration | P | R | C | |---|---|---|---| | depth=3, standard, gap=0.94 | 48B | ~500 KB | ~10,400:1 | | depth=2, open shell, gap=0.90 | 48B | ~80 KB | ~1,700:1 | | depth=3, corner cage, gap=0.96 | 48B | ~200 KB | ~4,200:1 | | depth=3, chaos 30% skip | 48B | ~350 KB | ~7,300:1 |
Architecture
The engine splits into two layers. The renderer shell (index.html) contains
zero algorithm logic. Every computation is delegated to window.MSE.* — the
proprietary API served from uuon.world/engine/menger-studio/core.js.
window.MSE = {
carve: MSE_carve, // E: recursive subdivision → cell array
gridSurf: MSE_gridSurf, // M: grid-coord adjacency → exterior mesh
version: '1.0.0',
}MSE_carve(depth, rootSize, gap, holeRule, skipPct, skipSeed) → Cell[]
MSE_gridSurf(cells, gap) → { pos, nor, idx, triCount }
The grid-coordinate surface extractor is the architectural IP. It tests adjacency
in discrete grid space using gx/gy/gz/gs coordinates stored per cell — not
world-space proximity. This is correct across all recursion depths because gs
matches the grid resolution at each level. A world-space proximity test fails
at depth boundaries. This does not.
IP Boundary
PROPRIETARY — USAL-1.0
- MSE_carve() — parameterized carving with holeRule + seeded pruner
- MSE_gridSurf() — grid-coordinate adjacency surface extractor
- window.MSE API surface
NOT PROPRIETARY — prior art
- Menger sponge topology (Karl Menger, 1926)
- Three.js (MIT)
- OBJ / STL format specifications (public domain)
- LCG random number generator (public domain)
Dependencies
| Library | Version | License | |---|---|---| | Three.js | r128 | MIT | | OrbitControls | r128 | MIT |
GLTFExporter is not used. OBJ and STL are hand-built.
Commercial Licensing
UUON Foundation Inc. · https://uuon.world
