# ultimaker/curaengine architecture

> Architecture diagram of the GitHub repository ultimaker/curaengine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ultimaker/curaengine
- Repository: https://github.com/ultimaker/curaengine

## Overview

##### Project type and purpose
- CuraEngine is a C++ console-application / library for 3D‐printing GCode generation.
- It ingests 3D models (STL/mesh) + print settings and produces a GCode toolpath.
- It can run standalone via CLI or be embedded (Arcus API, Emscripten, plugins).

##### File structure
- Top-level CMakeLists.txt, conanfile.py, project metadata (.github/, LICENSE, README).
- src/ and include/ contain the engine’s core:
- communication/ – CLI, Arcus (RPC), Emscripten bindings
- slicer/ & sliceDataStorage/ – layer construction from mesh
- pathPlanning/ & infill/ – interior infill algorithms and path planning
- BeadingStrategy/ & wall‐generation modules – shell/outer walls strategies
- PrimeTower, support/, TreeSupport – support-structure generation
- FffProcessor, FffGcodeWriter – GCode serialization
- settings/ – print settings model and storage
- utils/ – generic helpers: thread pool, grids, scoring, math
- benchmark/ & stress_benchmark/ – performance tests
- tests/ – unit and integration tests

##### README for insights
- “Better & faster alternative to Skeinforge,” “integral part of Cura.”
- Mentions Conan packaging, CMake build, Unit tests, Plugins and Extensibility.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input / Interface
    subgraph "Input / Interface"
        CLI["CommandLine"]:::external
        ARCUS["ArcusCommunication"]:::external
        EMS["EmscriptenCommunication"]:::external
    end

    %% Configuration
    subgraph "Configuration"
        SETTINGS["Settings Manager"]:::core
    end

    %% Geometry Loader & Preprocessor
    subgraph "Geometry Loader & Preprocessor"
        MESH["Mesh & MultiVolumes"]:::core
        SCENE["Scene"]:::core
    end

    %% Slicer
    subgraph "Slicer"
        SLICE["Slice"]:::core
        LPLAN["LayerPlan"]:::core
        LPBUF["LayerPlanBuffer"]:::core
    end

    %% Path Generation
    subgraph "Path Generation"
        SHELL["Shell & Walls"]:::core
        INFILL["Infill Algorithms"]:::ext
        SUPPORT["Support Structures"]:::ext
        PORDER["PathOrderOptimizer"]:::core
    end

    %% Output
    subgraph "Output"
        PROCESSOR["FffProcessor"]:::core
        WRITER["FffGcodeWriter"]:::core
    end

    %% Plugins & Extensibility
    subgraph "Plugins & Extensibility"
        PLUGIN["PluginProxy & Converters"]:::ext
    end

    %% Utilities & Shared Services
    subgraph "Utilities & Shared Services"
        THREAD["ThreadPool"]:::util
        AABB["AABB"]:::util
        MATH["Math & Scoring"]:::util
    end

    %% Testing & Benchmarking
    TESTS["tests/"]:::tests
    BENCH["benchmark/"]:::tests
    S_BENCH["stress_benchmark/"]:::tests

    %% Data Flow
    CLI -->|input| SETTINGS
    ARCUS -->|input| SETTINGS
    EMS -->|input| SETTINGS

    SETTINGS --> GEOM[Geometry Loader & Preprocessor]
    GEOM --> SLICE
    SLICE --> LPLAN
    LPLAN --> LPBUF
    LPBUF --> SHELL
    SHELL --> INFILL
    INFILL --> SUPPORT
    SUPPORT --> PORDER
    PORDER --> PROCESSOR
    PROCESSOR --> WRITER

    %% Shared dependencies
    SETTINGS -->|uses| SLICE
    SETTINGS -->|uses| SHELL
    SETTINGS -->|uses| INFILL
    SETTINGS -->|uses| SUPPORT
    SETTINGS -->|uses| PROCESSOR
    SETTINGS -->|uses| WRITER

    THREAD -->|utility| SETTINGS
    THREAD -->|utility| GEOM
    THREAD -->|utility| SLICE
    THREAD -->|utility| SHELL
    THREAD -->|utility| INFILL
    THREAD -->|utility| SUPPORT
    THREAD -->|utility| PROCESSOR
    THREAD -->|utility| WRITER
    AABB -->|utility| GEOM
    MATH -->|utility| INFILL

    %% Plugins integration
    PLUGIN -->|extends| SHELL
    PLUGIN -->|extends| INFILL
    PLUGIN -->|extends| PROCESSOR
    PLUGIN -->|extends| WRITER

    %% Tests & Benchmarks
    TESTS -.-> SETTINGS
    TESTS -.-> GEOM
    BENCH -.-> SETTINGS
    S_BENCH -.-> SETTINGS

    %% Click events
    click CLI "https://github.com/ultimaker/curaengine/blob/main/include/communication/CommandLine.h"
    click CLI "https://github.com/ultimaker/curaengine/blob/main/src/communication/CommandLine.cpp"
    click ARCUS "https://github.com/ultimaker/curaengine/blob/main/include/communication/ArcusCommunication.h"
    click ARCUS "https://github.com/ultimaker/curaengine/blob/main/include/communication/ArcusCommunicationPrivate.h"
    click ARCUS "https://github.com/ultimaker/curaengine/blob/main/src/communication/ArcusCommunication.cpp"
    click ARCUS "https://github.com/ultimaker/curaengine/blob/main/src/communication/ArcusCommunicationPrivate.cpp"
    click EMS "https://github.com/ultimaker/curaengine/blob/main/include/communication/EmscriptenCommunication.h"
    click EMS "https://github.com/ultimaker/curaengine/blob/main/src/communication/EmscriptenCommunication.cpp"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/include/settings/Settings.h"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/include/settings/PathConfigStorage.h"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/include/settings/AdaptiveLayerHeights.h"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/include/settings/ZSeamConfig.h"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/src/settings/Settings.cpp"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/src/settings/PathConfigStorage.cpp"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/src/settings/AdaptiveLayerHeights.cpp"
    click SETTINGS "https://github.com/ultimaker/curaengine/blob/main/src/settings/ZSeamConfig.cpp"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/include/mesh.h"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/include/MeshGroup.h"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/include/multiVolumes.h"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/src/mesh.cpp"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/src/MeshGroup.cpp"
    click MESH "https://github.com/ultimaker/curaengine/blob/main/src/multiVolumes.cpp"
    click SCENE "https://github.com/ultimaker/curaengine/blob/main/include/Scene.h"
    click SCENE "https://github.com/ultimaker/curaengine/blob/main/src/Scene.cpp"
    click SLICE "https://github.com/ultimaker/curaengine/blob/main/include/Slice.h"
    click LPLAN "https://github.com/ultimaker/curaengine/blob/main/include/LayerPlan.h"
    click LPBUF "https://github.com/ultimaker/curaengine/blob/main/include/LayerPlanBuffer.h"
    click SLICE "https://github.com/ultimaker/curaengine/blob/main/src/Slice.cpp"
    click LPLAN "https://github.com/ultimaker/curaengine/blob/main/src/LayerPlan.cpp"
    click LPBUF "https://github.com/ultimaker/curaengine/blob/main/src/LayerPlanBuffer.cpp"
    click SHELL "https://github.com/ultimaker/curaengine/blob/main/include/WallsComputation.h"
    click SHELL "https://github.com/ultimaker/curaengine/blob/main/include/WallToolPaths.h"
    click SHELL "https://github.com/ultimaker/curaengine/blob/main/src/WallsComputation.cpp"
    click SHELL "https://github.com/ultimaker/curaengine/blob/main/src/WallToolPaths.cpp"
    click INFILL "https://github.com/ultimaker/curaengine/blob/main/include/infill/DensityProvider.h"
    click INFILL "https://github.com/ultimaker/curaengine/blob/main/include/infill/GyroidInfill.h"
    click INFILL "https://github.com/ultimaker/curaengine/blob/main/include/infill/SierpinskiFill.h"
    click INFILL "https://github.com/ultimaker/curaengine/blob/main/src/infill/GyroidInfill.cpp"
    click INFILL "https://github.com/ultimaker/curaengine/blob/main/src/infill/SierpinskiFill.cpp"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/include/TreeSupport.h"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/include/TreeSupportBaseCircle.h"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/include/SupportInfillPart.h"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/include/PrimeTower/PrimeTower.h"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/src/TreeSupport.cpp"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/src/SupportInfillPart.cpp"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/src/PrimeTower/PrimeTower.cpp"
    click SUPPORT "https://github.com/ultimaker/curaengine/blob/main/src/PrimeTower/PrimeTowerInterleaved.cpp"
    click PORDER "https://github.com/ultimaker/curaengine/blob/main/include/PathOrderOptimizer.h"
    click PORDER "https://github.com/ultimaker/curaengine/blob/main/include/PathOrderMonotonic.h"
    click PORDER "https://github.com/ultimaker/curaengine/blob/main/include/path_ordering.h"
    click PORDER "https://github.com/ultimaker/curaengine/blob/main/src/path_ordering.cpp"
    click PROCESSOR "https://github.com/ultimaker/curaengine/blob/main/include/FffProcessor.h"
    click PROCESSOR "https://github.com/ultimaker/curaengine/blob/main/src/FffProcessor.cpp"
    click WRITER "https://github.com/ultimaker/curaengine/blob/main/include/FffGcodeWriter.h"
    click WRITER "https://github.com/ultimaker/curaengine/blob/main/include/gcodeExport.h"
    click WRITER "https://github.com/ultimaker/curaengine/blob/main/src/FffGcodeWriter.cpp"
    click WRITER "https://github.com/ultimaker/curaengine/blob/main/src/gcodeExport.cpp"
    click PLUGIN "https://github.com/ultimaker/curaengine/blob/main/include/plugins/pluginproxy.h"
    click PLUGIN "https://github.com/ultimaker/curaengine/blob/main/include/plugins/converters.h"
    click PLUGIN "https://github.com/ultimaker/curaengine/blob/main/src/plugins/converters.cpp"
    click THREAD "https://github.com/ultimaker/curaengine/blob/main/include/utils/ThreadPool.h"
    click THREAD "https://github.com/ultimaker/curaengine/blob/main/src/utils/ThreadPool.cpp"
    click AABB "https://github.com/ultimaker/curaengine/blob/main/include/utils/AABB.h"
    click AABB "https://github.com/ultimaker/curaengine/blob/main/src/utils/AABB.cpp"
    click MATH "https://github.com/ultimaker/curaengine/blob/main/include/utils/math.h"
    click MATH "https://github.com/ultimaker/curaengine/blob/main/src/utils/math.cpp"
    click TESTS "https://github.com/ultimaker/curaengine/tree/main/tests/"
    click BENCH "https://github.com/ultimaker/curaengine/tree/main/benchmark/"
    click S_BENCH "https://github.com/ultimaker/curaengine/tree/main/stress_benchmark/"

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef ext fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#FFD700,stroke:#000,stroke-width:1px
    classDef util fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef tests fill:#EEEEEE,stroke:#000,stroke-width:1px;font-style:italic
```
