CAM Architecture & Job Management
Relevant source files
The following files were used as context for generating this wiki page:
- src/Mod/CAM/Roadmap/ADR/ADR-000.md
- [src/Mod/CAM/Roadmap/Functionality/Job Management.md](https://github.com/TryParashell/Parashell/blob/44ee26aec7068593a3b395d52c51e27d893d9283/src/Mod/CAM/Roadmap/Functionality/Job Management.md)
- src/Mod/CAM/Path/Main/Sanity/Sanity.py
- src/Mod/CAM/Roadmap/README.md
- [src/Mod/CAM/Roadmap/Functionality/Operation Configuration.md](https://github.com/TryParashell/Parashell/blob/44ee26aec7068593a3b395d52c51e27d893d9283/src/Mod/CAM/Roadmap/Functionality/Operation Configuration.md)
- [src/Mod/CAM/Roadmap/Functionality/Output Generation.md](https://github.com/TryParashell/Parashell/blob/44ee26aec7068593a3b395d52c51e27d893d9283/src/Mod/CAM/Roadmap/Functionality/Output Generation.md)
The CAM (Computer-Aided Manufacturing) system within Parashell is a robust framework designed to translate 3D modeling workflows into professional CNC machining instructions. It integrates modeling geometry, stock definitions, and toolpath generation into a cohesive "Job" structure, supporting both professional and hobbyist CNC workflows through parametric updates and extensibility via Python.
Sources: src/Mod/CAM/Roadmap/README.md:16-23, src/Mod/CAM/Roadmap/ADR/ADR-000.md:14-16
Core CAM Components
The architecture is centered around the Job object, which acts as the top-level container for all machining project data. It manages the relationships between geometry, tools, and the final output parameters.
System Architecture Overview
The following diagram illustrates the primary entities managed within a CAM Job and their relationships.
Note: A Job orchestrates the interaction between physical machine definitions, post-processing logic, and the specific machining operations.
Sources: src/Mod/CAM/Roadmap/ADR/ADR-000.md:154-164
Principal Entities
| Entity | Description |
|---|---|
| Job | The top-level document object owning a single machining project. |
| Model | The part being machined, referenced via a Resource Clone to prevent mutation of original geometry. |
| Stock | The raw material representation. Types include FromBase, CreateBox, CreateCylinder, or NoStock. |
| Setup Sheet | A container for Job-specific default values like rapid speeds and safe-height expressions. |
| Operation (Op) | A single machining step (e.g., Pocket, Profile, Drilling) that produces a toolpath. |
| Tool Controller (TC) | The runtime pairing of a Tool Bit with specific spindle speeds and feed rates. |
Sources: src/Mod/CAM/Roadmap/ADR/ADR-000.md:18-100
Job Management Workflow
Job management involves configuring the environment where operations occur, including fixture selection and operation ordering.
Job Setup and Creation
The creation process groups operations into jobs or setups. It allows for multi-part workflows where multiple parts are supported in a single job. However, multi-setup workflows (processing the same part across different setups in one job) are currently not supported.
Sources: src/Mod/CAM/Roadmap/Functionality/Job Management.md:7-31
Fixture and Work Coordinate Systems (WCS)
Fixtures in this context represent WCS selections (G54–G59.9). A Job can output multiple fixtures, and the system can optimize across these fixtures to minimize tool changes.
Sources: src/Mod/CAM/Roadmap/Functionality/Job Management.md:32-35, src/Mod/CAM/Roadmap/ADR/ADR-000.md:54-58
Operation Logic and Toolpaths
Machining operations are the functional units that generate toolpaths. They are configured via Feature flags (e.g., FeatureTool, FeatureDepths) and properties.
Toolpath Generation Flow
Operations rely on low-level motion-pattern functions called Generators to build segments of a toolpath. The final toolpath is a sequence of motion commands (G0, G1, etc.) attached to the operation.
Note: Dressups wrap operations to modify paths in-place for features like holding tags or boundary trimming.
Sources: src/Mod/CAM/Roadmap/ADR/ADR-000.md:73-88, src/Mod/CAM/Roadmap/ADR/ADR-000.md:126-136
Sanity Checks (CAMSanity)
The system includes a validation utility, CAMSanity, which performs pre-flight checks before output generation. It flags issues such as missing tools, unset feeds, or missing model geometry.
Key validation methods in src/Mod/CAM/Path/Main/Sanity/Sanity.py:
_toolData(): Checks for legacy tools, duplicate tool numbers, and zero feedrates/spindle speeds._stockData(): Validates that stock material is specified._validate_job_structure(): Ensures the job contains at least one operation and base geometry.
Sources: src/Mod/CAM/Path/Main/Sanity/Sanity.py:270-380, src/Mod/CAM/Path/Main/Sanity/Sanity.py:464-490
Output Pipeline
The output pipeline converts internal toolpaths into machine-specific G-code via a Post-Processor.
Post-Processing Logic
- Machine Definition: The
.fcmfile describes the physical CNC (axes, units, limits). - Post-Processor Selection: A Python script (e.g.,
<machine>_post.py) converts paths to G-code. - Setup Page: An HTML report (Sanity Check report) is generated for the operator.
Sources: src/Mod/CAM/Roadmap/ADR/ADR-000.md:139-151, src/Mod/CAM/Roadmap/Functionality/Output Generation.md:21-25
Configuration Table
| Parameter | Type | Description |
|---|---|---|
| Start Depth | Property | Z height where cutting begins. |
| Step Down | Property | Axial increment between successive depth passes. |
| Step Over | Property | Radial increment perpendicular to tool axis across the surface. |
| Safe Height | Property | Z height for rapid moves within an operation. |
| Clearance Height | Property | Z height for safe rapids over physical fixtures/clamping. |
Sources: src/Mod/CAM/Roadmap/ADR/ADR-000.md:73-88
Summary
The CAM Architecture in Parashell provides a structured, hierarchical approach to machining projects through the Job object. By decoupling tool geometry (Tool Bit) from machining parameters (Tool Controller) and utilizing a robust validation system (CAMSanity), the project ensures accuracy and safety in professional CNC workflows. Parametric integration allows the system to respond to modeling changes, though current recompute efficiency remains a focus for future development.
Sources: src/Mod/CAM/Roadmap/README.md:16-23, src/Mod/CAM/Roadmap/ADR/ADR-000.md:154-164