Project Structure
A guide to every directory and file in the mesh-craft repository.
Top-Level Layout
mesh-craft/
├── CMakeLists.txt Root build script
├── README.md Project overview
├── PLAN.md Feature plan and status tracker
├── NEXT.md Handoff document / current state
├── LICENSE MIT license
├── imgui.ini ImGui window layout (auto-generated)
├── build-web.sh Emscripten build convenience script
│
├── src/ Application source (MeshCraft editor)
├── include/ Public headers
├── mc3/ Pure-C++ MC3 format sublibrary
├── mc3togltf/ Standalone MC3→glTF/GLB CLI converter
├── Mc3Format/ Format specification (Markdown)
├── cmake/ CMake helper scripts
├── test/ Test scenes and smoke test
│
└── cmake-build-debug/ Generated: debug build output (gitignored)
Source Directory: src/
Contains all C++ source files for the editor application.
src/MeshCraft/
├── main.cpp Entry point — creates MeshCraftApplication
├── MeshCraftApplication.cpp Main class: game loop, UI, scene state
│
├── Editor/
│ ├── EditorCamera.cpp Orbit/pan/zoom camera model
│ ├── EditorTool.cpp Tool state helpers
│ ├── EditorViewport.cpp Viewport rect helpers
│ ├── SelectionManager.cpp Selection tracking (multi-select)
│ └── TransformGizmo.cpp Gizmo drag state and axis enum
│
├── Renderer/
│ ├── GridRenderer.cpp XYZ infinite grid (line primitives)
│ └── SceneRenderer.cpp Full scene rendering + CSG + gizmos
│
├── Scene/
│ ├── PropertiesPanel.cpp Right panel: name, transform, material
│ └── SceneHierarchyPanel.cpp Left panel: recursive object tree
│
└── Ui/
└── BitmapFont.cpp 5×7 bitmap font (96 ASCII chars)
Include Directory: include/
Public headers. Organized to mirror the src/ structure.
include/MeshCraft/
├── MeshCraftApplication.hpp
├── Editor/
│ ├── EditorCamera.hpp
│ ├── EditorTool.hpp
│ ├── EditorViewport.hpp
│ ├── SelectionManager.hpp
│ └── TransformGizmo.hpp
├── Renderer/
│ ├── GridRenderer.hpp
│ └── SceneRenderer.hpp
├── Scene/
│ ├── PropertiesPanel.hpp
│ └── SceneHierarchyPanel.hpp
└── Ui/
└── BitmapFont.hpp
MC3 Sublibrary: mc3/
Pure C++ library — no graphics dependency. Builds as libMc3.a. Shared between the editor and mc3togltf.
mc3/
├── CMakeLists.txt Builds: Mc3 static library + mc3_roundtrip tests
├── MC3_FORMAT.md Authoritative format spec v0.3
├── mc3.xsd XML Schema Definition (v0.3)
│
├── include/MeshCraft/Mc3/
│ ├── Mc3Document.hpp Top-level scene container
│ ├── Mc3Object.hpp Scene graph node (ObjectType enum + data)
│ ├── Mc3Transform.hpp Position / rotation / scale / pivot
│ ├── Mc3Primitive.hpp Primitive shape params (box/sphere/etc.)
│ ├── Mc3Extrude.hpp Extrude cross-section + path params
│ ├── Mc3CsgOperation.hpp CSG boolean operation type
│ ├── Mc3Material.hpp PBR material (baseColor, roughness, …)
│ ├── Mc3Texture.hpp Texture definition (uri, wrap, filter)
│ ├── Mc3Light.hpp Light types and params
│ ├── Mc3Camera.hpp Camera types and params
│ ├── Mc3Environment.hpp Background + fog
│ ├── Mc3Deform.hpp Geometry-level deform scale
│ └── Mc3Animation.hpp Action / Channel / Keyframe types
│
└── src/
├── Mc3Document.cpp
├── Mc3Object.cpp
├── Mc3Primitive.cpp
├── Mc3Material.cpp
├── Mc3Texture.cpp
├── Mc3Animation.cpp
├── Mc3CsgOperation.cpp
├── Mc3XmlParser.hpp / .cpp tinyxml2-based XML → data model
├── Mc3XmlWriter.hpp / .cpp data model → XML
└── MathUtils.hpp Inline math utilities
mc3/test/
└── roundtrip_test.cpp 114 XML round-trip assertions (CTest)
Converter: mc3togltf/
Standalone CLI tool — parses MC3 XML and writes glTF 2.0 JSON or GLB. Has its own CMake build separate from the main editor.
mc3togltf/
├── CMakeLists.txt
├── src/
│ ├── main.cpp CLI entry point
│ ├── Mc3XmlParser.hpp/.cpp XML parser (copy from mc3/)
│ ├── GltfExporter.hpp/.cpp glTF/GLB writer (geometry + animation)
│ ├── MeshBuilder.hpp/.cpp Mesh tessellation from MC3 objects
│ └── MathUtils.hpp
└── test/
└── gltf_test.py Python test: 38 assertions on output GLTFs
Format Specification: Mc3Format/
Markdown documentation for the MC3 format. Not part of the build — this is the human-readable spec that informed the implementation.
Mc3Format/
├── README.md
├── purpose-and-goals.md
├── top-level-structure.md
├── coordinates-and-units.md
├── environment.md
├── lights.md
├── cameras.md
├── versioning.md
├── best-practices.md
├── future-extensions.md
├── objects/
│ ├── README.md, primitives.md, extrude.md, groups-and-hierarchy.md
│ ├── csg.md, definitions-and-instances.md, pivots.md, states.md
│ ├── collision.md, areas.md
├── materials/
│ ├── materials.md, textures.md, uv-mapping.md
├── actions/
│ ├── README.md, action-types.md, triggers.md
├── implementation/
│ ├── cpp-mapping.md, importer-behavior.md, minimal-implementation-order.md
└── examples/
├── minimal-example.md, complete-house.md
Test Data: test/
| File | Purpose |
|---|---|
house.mc3.xml | Simple house: group, primitives, materials — used by smoke test |
garden_house.mc3.xml | More complex house with garden |
features.mc3.xml | All MC3 features: lights, cameras, env, extrude, CSG, instances — v0.3 animation |
animation_test.mc3.xml | Animation demo: Bounce (cubic), Spin (linear), Flash (step), Pulse (cubic) |
csg_test.mc3.xml | CSG operations: box−sphere, two spheres, box∩sphere |
mesh_test.mc3.xml | External OBJ mesh loading test |
obj-test.mc3.xml | OBJ import test |
*.gltf / *.glb / *.bin | Reference exports for comparison |
meshes/teapot_minimal.obj | Minimal OBJ mesh for viewport testing |
smoke_test.sh | Bash script that runs the editor and checks screenshot size |
CMake Helpers: cmake/
cmake/
└── web/
└── pre.js Emscripten pre-JS: mounts IndexedDB filesystem (IDBFS)
Generated Directories (gitignored)
| Directory | Contents |
|---|---|
cmake-build-debug/ | Debug build: MeshCraft binary, ninja files, CNA/ImGui/Manifold build artifacts |
cmake-build-release/ | Release build |
cmake-build-web/ | Emscripten build: MeshCraft.html, .wasm, .js |
mc3togltf/build/ | mc3togltf standalone build: mc3togltf binary |
IDE Configuration: .idea/
JetBrains CLion project files. The project name is mesh-craft. The workspace.xml stores run configurations and build tool settings.