1
0
Fork
You've already forked StudiolaGeometry
0
No description
  • C++ 95.6%
  • CMake 4.4%
2026年06月07日 10:35:15 -07:00
include Add Splat and Voxel browsers 2026年06月05日 22:20:52 -07:00
src use camera provider for camera 2026年06月07日 10:35:15 -07:00
tests Excelsior! 2026年06月01日 13:08:10 -07:00
third_party Add Texture Coordinate Activity 2026年06月05日 08:19:33 -07:00
.gitignore Excelsior! 2026年06月01日 13:08:10 -07:00
CMakeLists.txt Add Splat and Voxel browsers 2026年06月05日 22:20:52 -07:00
GeometryPlugin.cpp Add Splat and Voxel browsers 2026年06月05日 22:20:52 -07:00
README.md Add geometry commands 2026年06月02日 22:34:57 -07:00
studiola-plugin.toml Excelsior! 2026年06月01日 13:08:10 -07:00

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