# anthonyz71/triple_5.25_to_four_3.5_hdd_cage architecture

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

- Interactive diagram: https://gitdiagram.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage
- Repository: https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage

## Overview

##### Project type and purpose
- This is an OpenSCAD-based CAD project whose goal is to generate STL models for a 3-bay to 4-drive HDD cage (with optional fan shroud), and to slice those STLs into printer-ready G-code using PrusaSlicer. A Makefile ties the whole pipeline together.

##### File structure
- Top-level files
- Makefile – orchestrates the build pipeline
- README.md – explains project purpose, parts list, printing notes
- Source models
- cage.scad – defines the main HDD cage and fan shroud geometry
- snap-pins.scad – defines the fan-shroud mounting pins
- Generated / published STLs
- fan_cover_*.stl – variants of the fan-cover grill
- Slicing configurations
- slicer.ini (global defaults)
- slicer-cage.ini, slicer-rail.ini, slicer-fan_shroud.ini, slicer-test.ini – per-part PrusaSlicer profiles

##### Key insights from README
- The pipeline: produce cage-cage.stl, cage-rail.stl, optional pin & fan_shroud.stl variants
- Printing notes: infill, supports, perimeters, tolerances
- Test print stage for validating tolerances

a. Main components
1. Developer/User
2. Makefile (build orchestrator)
3. OpenSCAD CLI (model compiler)
4. SCAD sources (cage.scad, snap-pins.scad)
5. Generated STLs (cage.stl, rail.stl, pin.stl, fan_cover_*.stl)
6. PrusaSlicer CLI (slicer)
7. Slicer config files (slicer.ini, slicer-*.ini)
8. G-code outputs
9. 3D Printer hardware

b. Relationships & data flow
- User invokes “make” → Makefile
- Makefile → calls OpenSCAD for each part (with appropriate parameters) → produces STL files
- Makefile → calls PrusaSlicer for each STL using its corresponding .ini → produces G-code files
- G-code files → sent to 3D printer → physical parts

c. Architectural patterns / design principles
- Pipeline / build automation: single entry point (Makefile)
- Declarative 3D modeling (OpenSCAD) separated from slicing configuration
- Separation of concerns: geometry generation vs. slicing vs. printing

d. Key technologies / tools
- OpenSCAD (geometry compiler)
- STL (3D mesh interchange)
- PrusaSlicer (slicer engine)
- Makefile (automation)
- G-code (printer instructions)
- 3D printer (Prusa MK3)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User & Orchestrator
    subgraph "User & Orchestrator"
        U["Developer/User"]:::external
        MF["Makefile (Build Orchestrator)"]:::software
        DOC["README.md (Documentation)"]:::artifact
    end

    U -->|invokes make| MF
    MF -->|reads docs| DOC

    %% Geometry Generation
    subgraph "Geometry Generation"
        OSC["OpenSCAD CLI"]:::software
        subgraph "SCAD Sources"
            CAGE["cage.scad"]:::artifact
            PINS["snap-pins.scad"]:::artifact
        end
    end

    MF -->|"calls OpenSCAD"| OSC
    OSC -->|"uses sources"| CAGE
    OSC -->|"uses sources"| PINS
    OSC -->|"outputs STLs"| STLS

    %% Generated STLs
    subgraph "Generated STLs" 
        STLS["STL Files"]:::artifact
        FC1["fan_cover_crosshair.stl"]:::artifact
        FC2["fan_cover_crosshex.stl"]:::artifact
        FC3["fan_cover_custom.stl"]:::artifact
        FC4["fan_cover_grid.stl"]:::artifact
        FC5["fan_cover_none.stl"]:::artifact
        FC6["fan_cover_teardrop.stl"]:::artifact
        FC7["fan_cover_web.stl"]:::artifact
    end

    OSC --> STLS
    STLS --> FC1
    STLS --> FC2
    STLS --> FC3
    STLS --> FC4
    STLS --> FC5
    STLS --> FC6
    STLS --> FC7

    %% Slicing
    subgraph "Slicing"
        PSC["PrusaSlicer CLI"]:::software
        subgraph "Slicer Configurations"
            GLOB["slicer.ini"]:::artifact
            CPROF["slicer-cage.ini"]:::artifact
            RPROF["slicer-rail.ini"]:::artifact
            FPROF["slicer-fan_shroud.ini"]:::artifact
            TPROF["slicer-test.ini"]:::artifact
        end
        GC["G-code Outputs"]:::artifact
    end

    MF -->|"calls slicer"| PSC
    PSC -->|"uses configs"| GLOB
    PSC -->|"uses configs"| CPROF
    PSC -->|"uses configs"| RPROF
    PSC -->|"uses configs"| FPROF
    PSC -->|"uses configs"| TPROF
    PSC -->|"processes STL"| STLS
    PSC --> GC

    %% Printing
    subgraph "Printing"
        PR["3D Printer (Prusa MK3)"]:::hardware
    end

    GC -->|send G-code| PR

    %% Optional/Test Branches
    TBR["Test Print Stage"]:::artifact
    GC -.->|validate tolerances| TBR
    TBR -.->|feedback| MF

    %% Click Events
    click MF "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/tree/main/./Makefile"
    click DOC "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./README.md"
    click CAGE "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./cage.scad"
    click PINS "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./snap-pins.scad"
    click FC1 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_crosshair.stl"
    click FC2 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_crosshex.stl"
    click FC3 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_custom.stl"
    click FC4 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_grid.stl"
    click FC5 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_none.stl"
    click FC6 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_teardrop.stl"
    click FC7 "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./fan_cover_web.stl"
    click GLOB "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./slicer.ini"
    click CPROF "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./slicer-cage.ini"
    click RPROF "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./slicer-rail.ini"
    click FPROF "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./slicer-fan_shroud.ini"
    click TPROF "https://github.com/anthonyz71/triple_5.25_to_four_3.5_hdd_cage/blob/main/./slicer-test.ini"

    %% Styles
    classDef software fill:#AED6F1,stroke:#21618C,stroke-width:1px
    classDef artifact fill:#ABEBC6,stroke:#1D8348,stroke-width:1px
    classDef hardware fill:#F5B041,stroke:#B9770E,stroke-width:1px
    classDef external fill:#D2B4DE,stroke:#7D3C98,stroke-width:1px
```
