E3Studio is an open-source CAM workbench for CNC workflows: import geometry, prepare stock and tools, create machining operations, preview toolpaths, simulate motion, and export G-Code.
The repository currently contains two clients around the same product idea:
- a Windows WPF desktop application in C# with the most complete UI and CAM workflow
- a cross-platform C++20 backend plus React/Three.js web UI that is being built out as the portable runtime
The project is early-stage. Some modules are production-shaped, while others are scaffolding or partial implementations. Treat generated G-Code as untrusted until it has been verified in your controller/simulator.
Current repository capabilities include:
-
WPF desktop CAM UI for Windows
- project creation, stock setup, save/load, recent projects, autosave
- 2D canvas workflow with layers, selection, transform tools, copy/cut/paste, undo/redo
- 3D stock/STL visualization through HelixToolkit
- dialogs for stock, materials, tools, settings, post processors, export, and imports
-
Import/export services
- SVG, DXF, STL, STEP/IGES, 3MF, PDF, Gerber, and G-Code importer service classes
- E3Studio project serialization through
.e3pJSON files
-
CAM and simulation services
- profile, pocket, drilling, V-carve, tab generation, lead-in/out, nesting, toolpath optimization, collision and stock-removal simulation classes
- realtime simulator/controller classes for G-Code playback
-
G-Code generation
- C# generator with model-aware safety heights, operation ordering, tool changes, spindle/coolant controls, and manual/canned drill cycle support
- C# post processors for GRBL, Generic/Fanuc style, Fanuc, Haas, Mazak, LinuxCNC, Mach3, and Mach4; the post-processor dialog also lists Klipper, Heidenhain, and Siemens Sinumerik presets
- C++ generator with Fanuc, Haas, Heidenhain, and generic ISO configurations
-
C++ backend prototype
- module layout for core project management, geometry, toolpath, simulation, machine, postprocessor, AI, and WebSocket API
- WebSocket server on
ws://localhost:9001 - JSON project state and operation management
- physics-based feed/speed fallback in the AI module; ONNX is intentionally disabled for now
-
React/Three.js web UI prototype
- Vite + React + TypeScript frontend
- Three.js viewport, operation panel, toolbar, notifications, Zustand store
- WebSocket client with reconnect handling
- English/Turkish i18n toggle
E3Studio/
├── App.xaml, MainWindow.xaml(.cs) Windows WPF desktop app
├── CAM/ C# CAM engines and simulation helpers
├── Controls/, Dialogs/, Models/ WPF UI and domain models
├── Services/ Importers, G-Code, settings, post processors
├── src/ C++20 backend modules
│ ├── core/ Application, logger, events, projects, threads
│ ├── geometry/ OpenCASCADE geometry and mesh processing
│ ├── toolpath/ Toolpath engine and operations
│ ├── simulation/ C++ simulation engine
│ ├── postprocessor/ C++ G-Code generation
│ ├── ai/ feed/speed prediction fallback
│ └── api/ WebSocket API server
├── ui/ React/Three.js web UI
├── docs/ architecture, API, post-processor docs
├── build.sh, build.ps1 local build scripts
├── launch.sh, launch.ps1 local launch scripts
├── CMakeLists.txt, vcpkg.json C++ build and dependencies
└── E3Studio.csproj, E3Studio.sln WPF/.NET build files
- C++20, CMake 3.25+, vcpkg
- OpenCASCADE, Boost, nlohmann/json, ixwebsocket, spdlog
- .NET 10 WPF, HelixToolkit.Wpf, AvalonDock, System.IO.Ports
- React 18, TypeScript, Vite, Three.js, React Three Fiber, Zustand, Immer, Tailwind CSS, i18next
- Docker for Linux container builds
Requirements:
- CMake 3.25+
- Ninja or a supported CMake generator
- a C++20 compiler
- Node.js 20+ and npm
- Git
- vcpkg is bootstrapped by the build scripts if missing
On macOS:
brew install cmake ninja node
./build.sh
./launch.sh --devOn Ubuntu/Debian:
sudo apt-get update
sudo apt-get install -y build-essential cmake git ninja-build nodejs npm \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libfontconfig1-dev libssl-dev
./build.sh
./launch.sh --devCommon script options:
./build.sh --release # Release build
./build.sh --no-ui # C++ backend only
./build.sh --clean # remove build/<type> first
./build.sh --parallel 8 # choose build parallelism
./launch.sh --dev # backend + Vite dev server
./launch.sh --backend-only # backend only
./launch.sh --ui-only --dev # Vite UI onlyThe backend listens on ws://localhost:9001. The web UI runs at http://localhost:3000 in the scripts/docs, although Vite may choose another port if 3000 is already occupied.
Requirements:
- Windows 10/11
- Visual Studio 2022 with C++ workload if building the C++ backend
- .NET 10 SDK
- Node.js 20+ if building the web UI
.\build.ps1
.\launch.ps1Useful build variants:
.\build.ps1 -Release
.\build.ps1 -NoBuildUI
dotnet build -c ReleaseThe WPF client is Windows-only because it targets net10.0-windows and UseWPF=true.
# Configure C++ backend
cmake -B build/Debug -S . \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-G Ninja
# Build C++ backend
cmake --build build/Debug --parallel
# Build web UI
cd ui
npm ci
npm run builddocker compose up --buildCurrent Docker notes:
- the image builds the C++ backend and web UI
- ports 3000 and 9001 are exposed
- the checked-in Dockerfile command starts only
/app/E3Studio; serve/static UI startup may need adjustment if you want a single container to host both backend and UI
The C++ backend exposes a JSON-over-WebSocket API. The implemented dispatch table currently handles:
project.new,project.open,project.save,project.getoperation.add,operation.update,operation.remove,operation.computetoolpath.get,toolpath.exportsimulation.start,simulation.step,simulation.pauseai.optimizemodel.load,mesh.get
See docs/API.md for the current protocol and message shapes. Older names such as import.stl, toolpath.generate, and export.gcode are not the current C++ API names.
docs/ARCHITECTURE.mdexplains the hybrid C# / C++ / React architecture and module responsibilities.docs/API.mddocuments the current WebSocket protocol implemented bysrc/api/MessageHandler.cpp.docs/POST_PROCESSORS.mdexplains post-processor behavior and controller-specific G-Code considerations.CONTRIBUTING.mdcovers contribution workflow and project conventions.
- The C++ code currently uses Turkish comments/log messages in several files. The React UI has English and Turkish runtime strings.
- The C++ API returns
status: "ok"plus adataobject for successful responses, orstatus: "error"plusmessagefor failures. - The React file input uses
(file as any).path ?? file.name; browsers usually expose only the file name, so full-path loading is mainly suitable for desktop/Electron-like environments or future file-upload handling. ai.optimizeis deterministic physics fallback today, not a trained model inference path.- There are no dedicated automated test projects in the repository yet; build verification is the main quality gate.
CNC output can damage machines, stock, tooling, or injure people. Always dry-run, simulate, inspect clearances, verify work offsets, and test with the spindle disabled before running generated G-Code on real hardware.
MIT. See LICENSE.