Docs / Getting Started

Prerequisites

Compiler

MeshCraft requires a C++23-capable compiler:

CompilerMinimum Version
GCC13+
Clang16+
MSVC2022 (17.6+)

Build Tools

System Libraries (Linux)

sudo apt install libgles2-mesa-dev libgl-dev libsdl3-dev
ℹ️

The exact packages depend on how CNA resolves SDL3 and OpenGL. SDL3 may also be fetched and built by CNA's own CMakeLists.txt.

Cloning the Repositories

MeshCraft depends on three sibling repositories that must exist next to the mesh-craft directory:

mkdir openeggbert && cd openeggbert

git clone https://github.com/openeggbert/cna
git clone https://github.com/openeggbert/sharp-runtime
git clone https://github.com/openeggbert/nova-3d
git clone https://github.com/openeggbert/mesh-craft

ls
# cna  sharp-runtime  nova-3d  mesh-craft
⚠️
Directory layout is strict

CMakeLists.txt uses add_subdirectory(../cna CNA_dep). If the sibling repos are not at the expected relative paths, the build will fail immediately with a CMake error.

Configuring and Building

cd mesh-craft

# Configure with the default EasyGL backend (Linux desktop)
cmake -S . -B cmake-build-debug \
      -DCMAKE_BUILD_TYPE=Debug \
      -DMESH_CRAFT_GRAPHICS_BACKEND=EASYGL

# Build (all CPU cores)
cmake --build cmake-build-debug --target MeshCraft -- -j$(nproc)

The first build downloads ImGui, Manifold, and tinyobjloader via CMake's FetchContent. This requires internet access. Subsequent builds use the cached downloads.

Running the Editor

# Open an empty new scene
./cmake-build-debug/MeshCraft

# Open an existing test scene
./cmake-build-debug/MeshCraft test/house.mc3.xml

# Auto-screenshot mode (exits after ~2 s — useful for CI)
./cmake-build-debug/MeshCraft test/house.mc3.xml --screenshot /tmp/editor.ppm

Keyboard Shortcuts

ShortcutAction
Ctrl+NNew scene
Ctrl+OOpen file (in-editor dialog)
Ctrl+SSave
Ctrl+Shift+SSave As
Ctrl+EExport to GLB (via mc3togltf)
Ctrl+ZUndo
Ctrl+YRedo
Ctrl+DDuplicate selection
Ctrl+ASelect all objects (if nothing selected) / select all children in group
Ctrl+GGroup selected objects
Ctrl+Shift+GUngroup selected group
Ctrl+X / C / VCut / Copy / Paste
DeleteDelete selected objects
QSelect tool (no gizmo)
GMove (Translate) gizmo
RRotate gizmo
SScale gizmo
FFocus camera on selection (or reset view if nothing selected)
F1Add Box
F2Add Sphere
F3Add Cylinder
F4Add Cone
F5Add Plane
F11Save screenshot to screenshot.ppm
Ctrl+TToggle timeline panel
SpacePlay/pause animation (when timeline is open)
Alt+WToggle edge wireframe overlay
Arrow keysNudge selected object ±0.1 units on X/Y axis
Page Up / Page DownNudge selected object ±0.1 units on Z axis

Camera Controls

InputAction
Middle-mouse dragOrbit
Right-mouse dragPan
Scroll wheelZoom in/out
FFocus on selection (reset view if nothing selected)
Numpad 1Front view (yaw=0°, pitch=0°)
Numpad 3Right view (yaw=90°, pitch=0°)
Numpad 5Back view (yaw=180°, pitch=0°)
Numpad 7Top view (yaw=0°, pitch≈84°)
Numpad 9Bottom view (yaw=0°, pitch≈−84°)

Building the mc3togltf Converter

The mc3togltf converter is a standalone binary required for File → Export GLB. It has its own CMake build:

cmake -S mc3togltf -B mc3togltf/build -DCMAKE_BUILD_TYPE=Release
cmake --build mc3togltf/build --parallel

# Test conversion
./mc3togltf/build/mc3togltf test/house.mc3.xml test/house.glb

Running the Tests

ctest --test-dir cmake-build-debug -V

This runs two test suites:

  1. smoke_test — launches the editor with test/house.mc3.xml, takes a screenshot, and verifies the file is ≥ 1 MB.
  2. mc3_roundtrip — 114 XML round-trip checks covering all MC3 field types and animation data.
💡

If the smoke test fails with a display error, set DISPLAY=:0 or use a virtual framebuffer (Xvfb) for headless CI environments.

Next Steps