|
|
||
|---|---|---|
| include | Add Splat and Voxel browsers | |
| src | use camera provider for camera | |
| tests | Excelsior! | |
| third_party | Add Texture Coordinate Activity | |
| .gitignore | Excelsior! | |
| CMakeLists.txt | Add Splat and Voxel browsers | |
| GeometryPlugin.cpp | Add Splat and Voxel browsers | |
| README.md | Add geometry commands | |
| studiola-plugin.toml | Excelsior! | |
StudiolaGeometry
MeshulaLab plugin that provides an opaque-handle geometry lifecycle: create, list, query, and remove 3D mesh primitives (Goldberg polyhedra + par_shapes shapes).
Copyright (c) 2026 Nick Porcino · BSD 2-Clause
Overview
StudiolaGeometry exposes a GeometryProvider — a MeshulaLab provider that owns a
GeometryStore (the pure C++ data layer) and surfaces geometry objects as
opaque GeometryHandles. This is the same handle-based pattern used by
texture providers: the heavy mesh data stays behind the handle, and activities
or commands stream it on demand.
The plugin ships four components:
| Component | What it does |
|---|---|
| GeometryStore | Header + source in include/ / src/. A MeshulaLab-free store that creates Goldberg polyhedra and par_shapes primitives, tracks them by handle, and exposes list() / info() / mesh() / remove(). Used by the standalone tests. |
| GeometryProvider | Wraps GeometryStore as a MeshulaLab::Provider — the lifecycle API consumed by the Activity and Commands. |
| GeometryBrowserActivity | An ImGui-based activity (list + create modal + LabGL preview) that drives the provider. |
| GeometryCommands | Registers a LabCmd2 geometry domain (CLI / MCP / REST / JSON-RPC) — the same provider API exposed as commands over every transport. |
Supported Shapes
| Kind | Description |
|---|---|
| Goldberg | Geodesic Goldberg polyhedron (from LabGeomVoxSplat/geodesic) |
| Sphere | Subdivided icosphere (from par_shapes.h) |
| Torus | Parametric torus |
| Cylinder | Parametric cylinder |
| Plane | Subdivided plane |
| KleinBottle | Klein bottle |
| TrefoilKnot | Trefoil knot |
| Dodecahedron | Platonic dodecahedron |
| Icosahedron | Platonic icosahedron |
| Octahedron | Platonic octahedron |
| Tetrahedron | Platonic tetrahedron |
| Cube | Platonic cube |
| Rock | Procedural rock |
Command Domain
The plugin registers a geometry LabCmd2 domain with the following subcommands:
| Command | Description |
|---|---|
geometry:shapes |
List all available shape kinds |
geometry:create-goldberg |
Create a Goldberg polyhedron, returns handle |
geometry:create-shape |
Create a par_shapes primitive, returns handle |
geometry:count |
Number of objects in the store |
geometry:list |
Flat list of all objects (handle, name, kind, params, verts, tris) |
geometry:info |
Metadata for a specific handle |
geometry:mesh |
Full mesh data (positions, normals, indices, AABB) |
geometry:remove |
Remove an object by handle |
geometry:clear |
Remove all objects |
All commands are non-journaled (journalable = false).
Building
cd build-plug
cmake ..
make
The plugin requires:
- MeshulaLab (installed or found via
find_package(MeshulaLab)) - LabGeomVoxSplat (geodesic/goldberg headers — sibling checkout)
- LabGL (par_shapes.h — sibling checkout)
If MeshulaLab is not found, the geometry core and tests still build.
# Core + tests only (no MeshulaLab)
mkdir build && cd build && cmake .. && make
ctest
Project Layout
StudiolaGeometry/
├── CMakeLists.txt # Build config
├── GeometryPlugin.cpp # Plugin descriptor + command registration
├── include/
│ ├── GeometryProvider.hpp # Provider class (wraps store)
│ └── GeometryStore.hpp # Handle-based geometry store
├── src/
│ ├── GeometryProvider.cpp # Provider implementation
│ ├── GeometryCommands.hpp # LabCmd2 domain registration
│ ├── GeometryCommands.cpp # geometry:* command handlers
│ ├── GeometryStore.cpp # Store implementation
│ ├── Activities/
│ │ └── GeometryBrowser/ # ImGui browser activity
│ └── Studios/
│ └── GeometryStudio.hpp # Studio configuration
├── tests/
│ └── test_geometry_store.cpp # Standalone store tests
└── studiola-plugin.toml # Plugin metadata