How dlr-sc/tigl works
The TiGL project is a large-scale, multi‐language, geometry processing framework that computes and manipulates aircraft geometries stored in CPACS files. Its core is built in C/C++ (using CMake for configuration and build), and it wraps its functionality for several external interfaces, including Python, Java, MATLAB, and FORTRAN. In addition, it provides a Qt-based GUI called the “TiGL Viewer” for visualization. The code also draws on heavy geometry processing using the OpenCASCADE CAD kernel.
Main Components
• Core Geometry Engine: This resides in the “src” directory and is split into many aspects like:
– CPACS Parsing/Configuration (directories such as src/configuration and src/generated).
– Geometric computations (subdirectories like src/geometry, src/guide_curves, src/wing, src/fuselage, src/engine_nacelle, etc.).
– Boolean operations and CAD export, for instance in src/exports.
– Utilities like logging (src/logging), math (src/math), and system support (src/system).
• API/Interface Layer: The “src/api” directory exposes functions to external applications (for C/C++).
• Language-Specific Bindings: The “bindings” directory provides language wrappers (Python, Java, MATLAB, FORTRAN) so that the geometry engine can be used externally.
• Graphical User Interface: The “TIGLViewer” directory hosts the Qt-based visualization tool so that users can load and examine aircraft geometries.
• Testing and Continuous Integration: There are extensive tests (in tests) plus CI (via .github/workflows and CI directories) that form an essential part of the quality assurance architecture.
• Build System & Tooling: CMake files in the root and subdirectories along with CI scripts (ci, cmake) orchestrate compilation and integration with external third-party libraries and tools (notably OpenCASCADE, boost, and googletest).
Relationships and Interactions
• CPACS Input → CPACS Parser (configuration modules in “src/configuration” and “src/generated”) → Core Geometry Engine.
• The Core Geometry Engine relies on the OpenCASCADE CAD kernel (an external library) for representing and operating on NURBS surfaces.
• The computed geometry data is then provided through the API (src/api) to external clients.
• Language-specific bindings in “bindings” wrap the native API functions and allow usage in Python, Java, MATLAB, and FORTRAN.
• The TiGL Viewer (in TIGLViewer) directly uses the core geometry engine through the C++ API for rendering and interacting with the geometry.
• The export modules (under src/exports) provide conversion of the internal geometry to standard formats like STEP, IGES, VTK, STL, etc.
• Tests (unit and integration) interface with almost every part of the system to ensure correctness and robustness.
• CI pipelines (via GitHub Actions and Conda scripts in ci) trigger builds and tests for multiple operating systems, ensuring cross-platform compatibility.
Architectural Patterns & Design Principles
• Layered/Multi-tiered design: With a clear separation between the core computational logic, API exposure, and presentation (GUI and language bindings).
• Modularity: The code is divided into a large number of modules (configuration, geometry, wing, fuselage, engine, etc.). Each module is developed and tested more or less independently.
• Abstraction and Interface Orientation: The use of an API layer (src/api) and language bindings abstract the core engine from application-specific implementations.
• Reusability and Extensibility: Bindings to many languages allow TiGL to be reused in different environments, and its export functions facilitate integration with external CAD tools.
• Continuous integration and testing principles: Underlined by the extensive test directories and CI configurations.