Part of #764. Depends on Slice B (predictor returns vertex/index arrays).
Goal
Turn MeshGenPredictor::Result float arrays into an Ogre::Mesh, attach it to the scene, and export it — reusing the project's standard mesh-build + export paths.
Work
- New helper (in
MeshGenPredictor or a small MeshBuilder): build Ogre::Mesh from positions/indices via MeshManager::createManual → VertexDeclaration (POSITION + NORMAL, +DIFFUSE if colors) → HardwareVertexBuffer/HardwareIndexBuffer (IT_16BIT if ≤65536 verts else IT_32BIT) → _setBounds/_setBoundingSphereRadius → load(). Recipe: src/TestHelpers.h createInMemoryTriangleMesh (~241–282).
- Compute per-vertex normals by accumulating face normals (marching-cubes output may lack them).
- Attach: create entity + child
SceneNode under Manager::getSingleton()->getSceneMgr() root (headless via initOgreHeadless() in CLI; live scene in GUI).
- Export:
MeshImporterExporter::exporter(node, outputPath, format) — default .glb; honor requested extension.
- Apply the auto-scale convention
MeshImporterExporter already uses for sub-unit meshes so generated meshes frame correctly.
Tests
- Build a mesh from a known cube SDF (Slice A) → assert vertex/triangle counts, non-degenerate bounds, normals roughly unit-length.
- Round-trip: build → export
.glb → re-import → counts match (skip if no GL/Ogre).
Acceptance
Part of #764. Depends on Slice B (predictor returns vertex/index arrays).
Goal
Turn
MeshGenPredictor::Resultfloat arrays into anOgre::Mesh, attach it to the scene, and export it — reusing the project's standard mesh-build + export paths.Work
MeshGenPredictoror a smallMeshBuilder): buildOgre::Meshfrompositions/indicesviaMeshManager::createManual→VertexDeclaration(POSITION + NORMAL, +DIFFUSE ifcolors) →HardwareVertexBuffer/HardwareIndexBuffer(IT_16BIT if ≤65536 verts else IT_32BIT) →_setBounds/_setBoundingSphereRadius→load(). Recipe:src/TestHelpers.hcreateInMemoryTriangleMesh(~241–282).SceneNodeunderManager::getSingleton()->getSceneMgr()root (headless viainitOgreHeadless()in CLI; live scene in GUI).MeshImporterExporter::exporter(node, outputPath, format)— default.glb; honor requested extension.MeshImporterExporteralready uses for sub-unit meshes so generated meshes frame correctly.Tests
.glb→ re-import → counts match (skip if no GL/Ogre).Acceptance
Ogre::Meshwith normals + correct bounds..glbre-imports cleanly with matching geometry.