# zamtmn/zcad architecture

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

- Interactive diagram: https://gitdiagram.com/zamtmn/zcad
- Repository: https://github.com/zamtmn/zcad

## Overview

ZCAD is a Lazarus/FPC desktop CAD application. Its documented user-facing capabilities cover creating and viewing drawings, working with supported DXF entities, and using tracking and object snaps; the README also highlights rendering and font support. The tree identifies the application, graphics engine, GUI, and electrotechnical extension locations, but no source excerpts were provided, so internal call paths cannot be verified. Edges from the application to capabilities reflect README documentation, not inspected implementation calls.

Main entry points: [`cad_source/zcad.pas`](https://github.com/zamtmn/zcad/blob/master/cad_source/zcad.pas) (ZCAD app), [`cad_source/zengine/fileformats/dwg`](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/fileformats/dwg) (DXF support), [`cad_source/zcad/entities`](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/entities) (Drawing entities), [`cad_source/zcad`](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad) (Tracking and snaps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["CAD application"]
  node_zcad["ZCAD app<br/>[zcad.pas]"]
  node_gui["CAD interface"]
  node_commands["CAD commands"]
end

subgraph group_drawing["Drawing work"]
  node_dxf["DXF support"]
  node_entities["Drawing entities"]
  node_tracking["Tracking and snaps"]
end

subgraph group_graphics["Graphics"]
  node_engine["Graphics engine"]
  node_opengl["OpenGL rendering"]
  node_gdi["GDI rendering"]
  node_fonts["Font support"]
end

subgraph group_extensions["Specialized tools"]
  node_electro["Electrotechnical CAD"]
  node_velec["Electrical tools"]
end

node_user(("CAD user"))

node_user -->|"uses"| node_zcad
node_zcad -->|"supports DXF"| node_dxf
node_zcad -->|"supports entities"| node_entities
node_zcad -->|"provides tracking"| node_tracking
node_zcad -->|"renders drawings"| node_engine
node_zcad -->|"supports rendering"| node_opengl
node_zcad -->|"supports rendering"| node_gdi
node_zcad -->|"supports fonts"| node_fonts
node_zcad -->|"offers variant"| node_electro

click node_zcad "https://github.com/zamtmn/zcad/blob/master/cad_source/zcad.pas"
click node_gui "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/gui"
click node_commands "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/commands"
click node_dxf "https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/fileformats/dwg"
click node_entities "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/entities"
click node_tracking "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad"
click node_engine "https://github.com/zamtmn/zcad/tree/master/cad_source/zengine"
click node_opengl "https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/zgl/opengl"
click node_gdi "https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/zgl/gdi"
click node_fonts "https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/fonts"
click node_electro "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/electrotech"
click node_velec "https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/velec"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_zcad,node_gui,node_commands,node_user toneBlue
class node_dxf,node_entities,node_tracking toneAmber
class node_engine,node_opengl,node_gdi,node_fonts toneMint
class node_electro,node_velec toneRose
```

## Components

### CAD application

- [ZCAD app](https://github.com/zamtmn/zcad/blob/master/cad_source/zcad.pas): `cad_source/zcad.pas`
- [CAD interface](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/gui): `cad_source/zcad/gui`
- [CAD commands](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/commands): `cad_source/zcad/commands`

### Drawing work

- [DXF support](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/fileformats/dwg): `cad_source/zengine/fileformats/dwg`
- [Drawing entities](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/entities): `cad_source/zcad/entities`
- [Tracking and snaps](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad): `cad_source/zcad`

### Graphics

- [Graphics engine](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine): `cad_source/zengine`
- [OpenGL rendering](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/zgl/opengl): `cad_source/zengine/zgl/opengl`
- [GDI rendering](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/zgl/gdi): `cad_source/zengine/zgl/gdi`
- [Font support](https://github.com/zamtmn/zcad/tree/master/cad_source/zengine/fonts): `cad_source/zengine/fonts`

### Specialized tools

- [Electrotechnical CAD](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/electrotech): `cad_source/zcad/electrotech`
- [Electrical tools](https://github.com/zamtmn/zcad/tree/master/cad_source/zcad/velec): `cad_source/zcad/velec`

### Other components

- **CAD user**

## Connections

- CAD user → ZCAD app: uses (evidence: `README.md`)
- ZCAD app → DXF support: supports DXF (evidence: `README.md`)
- ZCAD app → Drawing entities: supports entities (evidence: `README.md`)
- ZCAD app → Tracking and snaps: provides tracking (evidence: `README.md`)
- ZCAD app → Graphics engine: renders drawings (evidence: `README.md`)
- ZCAD app → OpenGL rendering: supports rendering (evidence: `README.md`)
- ZCAD app → GDI rendering: supports rendering (evidence: `README.md`)
- ZCAD app → Font support: supports fonts (evidence: `README.md`)
- ZCAD app → Electrotechnical CAD: offers variant (evidence: `README.md`)
