High-Level Architecture
Relevant source files
The following files were used as context for generating this wiki page:
- CONTRIBUTING.md
- src/Mod/CAM/Roadmap/README.md
- src/Mod/Draft/coding_conventions.md
- src/Mod/Fem/coding_conventions.md
- src/Doc/sphinx/conf.py
- [src/Mod/CAM/Roadmap/Functionality/Job Management.md](https://github.com/TryParashell/Parashell/blob/44ee26aec7068593a3b395d52c51e27d893d9283/src/Mod/CAM/Roadmap/Functionality/Job Management.md)
- src/Doc/FreecadDoxygenLayout.xml
Parashell, as a fork of FreeCAD, inherits a highly modular and extensible architecture designed to support a wide range of engineering disciplines, including Computer-Aided Design (CAD), Computer-Aided Manufacturing (CAM), and Finite Element Method (FEM) analysis. The system is built on a core application framework that manages documents, while specific functionalities are encapsulated within "Workbenches" or modules.
The architecture emphasizes a strict separation between application logic and graphical user interface (GUI) components, enabling both interactive use and automated scripting via Python. This structure ensures that core geometric operations can be performed independently of the rendering pipeline.
Sources: CONTRIBUTING.md:1, src/Mod/Draft/coding_conventions.md:54-56, src/Doc/sphinx/conf.py:56-58
Core System and Workbench Integration
The system follows a hub-and-spoke model where the core application provides shared services (modeling workflows, unit schemas, translation) and individual modules provide specialized logic. Modules like CAM, Draft, and FEM integrate seamlessly with this core to provide a consistent user experience.
Component Relationship
The following diagram illustrates how specialized workbenches interact with the core application services.
This diagram shows the relationship between core application services and specialized workbench modules.
Sources: src/Mod/CAM/Roadmap/README.md:19-25, src/Mod/Draft/coding_conventions.md:2-4, src/Mod/Fem/coding_conventions.md:2
Modular Workbench Structure
Each workbench in Parashell follows a standardized internal structure to maintain code quality and prevent circular dependencies. Key conventions include keeping file sizes manageable (typically under 1000 lines) and breaking large classes into smaller, inherited subclasses.
Internal Module Organization
| Layer | Description | Implementation Detail |
|---|---|---|
| Logic Layer | Contains console-only functions and mathematical operations. | Separate from GUI implementations to support headless mode. |
| GUI Layer | Handles user interaction through GuiCommands and Task Panels. | Guarded by FreeCAD.GuiUp checks during module import. |
| Data Layer | Stores persistent information such as IFC properties or tool paths. | Often implemented as spreadsheets or specialized data structures. |
Sources: src/Mod/Draft/coding_conventions.md:14-18, 54-56, src/Mod/Fem/coding_conventions.md:105-115, src/Mod/CAM/Roadmap/Functionality/Job Management.md:12-15
Functional Architecture (CAM Example)
The CAM Workbench architecture specifically focuses on professional CNC workflows. It is structured to handle Job Management, which includes grouping operations into workplans, managing stock/workpiece setups, and generating output for specific machine types.
This flowchart describes the data flow within the CAM module from geometry input to final output generation.
Sources: src/Mod/CAM/Roadmap/Functionality/Job Management.md:4-10, 24-28
Interface and Scripting Layer
A defining feature of the architecture is its extensibility via Python. The system exposes a Python API that allows for the automation of modeling tasks. For modules to be considered "well-behaved," they must ensure that graphical interface imports do not break console-based execution.
Separation of Concerns
- Console Functions: Pure logic and data manipulation that do not require a display.
- GuiCommands: Wrappers around console functions that provide buttons, icons, and interactive task panels.
- Task Panels: Separate packages for UI components to reduce merge conflicts and improve load times.
Sources: src/Mod/Draft/coding_conventions.md:54-56, src/Mod/Fem/coding_conventions.md:105-115, src/Doc/sphinx/conf.py:56-57
Development and Governance Architecture
The project employs a decentralized "Maintainer" model based on the Collective Code Construction Contract. This architecture of human governance is designed to minimize dependence on individual contributors and ensure transparency.
The sequence of contribution from problem identification to code integration.
Sources: CONTRIBUTING.md:18-20, 29-32, 140-150
Conclusion
The High-Level Architecture of Parashell is built on the principles of modularity, interface separation, and open standards. By enforcing strict coding conventions and a clear workbench-to-core hierarchy, the system maintains a robust framework for professional engineering tasks across diverse domains like BIM, CAM, and FEM.
Sources: src/Mod/CAM/Roadmap/README.md:19-25, src/Mod/Draft/coding_conventions.md:1-5, src/Doc/FreecadDoxygenLayout.xml