# martinpazmino/groundtwin architecture

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

- Interactive diagram: https://gitdiagram.com/martinpazmino/groundtwin
- Repository: https://github.com/martinpazmino/groundtwin

## Overview

GroundTwin turns geotechnical PDFs or a mapped site into a reviewed, traceable IFC 4.3 ground model, then presents it in an interactive viewer. The main workflow runs from extraction through review and location calibration to unit interpretation, geometry, and IFC export. Separate capabilities include state geodata comparisons, terrain and buildings, BoreholeML exchange, and a legacy Excel export. Edges are limited to relationships visible in the supplied excerpts, SOURCE INDEX references, or README; unsampled subsystem wiring is not assumed.

Main entry points: [`ui/pipeline.py`](https://github.com/martinpazmino/groundtwin/blob/main/ui/pipeline.py) (Extraction pipeline), [`services/modeler/baugrundmodell/modell.py`](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/modell.py) (Ground model), [`ui/projekt.py`](https://github.com/martinpazmino/groundtwin/blob/main/ui/projekt.py) (Project review), [`app.py`](https://github.com/martinpazmino/groundtwin/blob/main/app.py) (Excel app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Project workflow"]
  node_server["HTTP API<br/>[api.py]"]
  node_workspace["Project workspace<br/>[arbeitsplatz.py]"]
  node_pipeline["Extraction pipeline<br/>[pipeline.py]"]
  node_extract["PDF extraction<br/>[prototyp_v4.py]"]
  node_review["Project review<br/>[projekt.py]"]
  node_sounding["Sounding extraction<br/>[sondierungen.py]"]
end

subgraph group_model["Ground modeling"]
  node_units["Model units<br/>[einheiten.py]"]
  node_norms["Soil norms<br/>[normen.py]"]
  node_surfaces["Layer surfaces<br/>[flaechen.py]"]
  node_groundmodel["Ground model<br/>[modell.py]"]
  node_ifc["IFC export<br/>[ifc4x3.py]"]
  node_homogeneous["Homogeneous zones<br/>[homogenbereiche.py]"]
  node_soilvalues["Soil parameters<br/>[bodenkennwerte.py]"]
end

subgraph group_geo["Geodata and exchange"]
  node_geoqueries["State boreholes<br/>[bohrdaten.py]"]
  node_boreholeml["BoreholeML exchange<br/>[boreholeml.py]"]
  node_terrain["Terrain and context<br/>[gelaende.py]"]
  node_buildings["3D buildings<br/>[gebaeude.py]"]
end

subgraph group_client["Web application"]
  node_webapp["Step application<br/>[schritt_lage.ts]"]
  node_api_client["Web API client<br/>[api.ts]"]
  node_viewer["IFC viewer<br/>[viewer.ts]"]
  node_viewer_location["Plan location editor<br/>[lage.ts]"]
end

subgraph group_legacy["Excel export"]
  node_excel_app["Excel app<br/>[app.py]"]
  node_excel_profile["Borehole profile<br/>[bohrprofil.py]"]
  node_excel_section["Longitudinal section<br/>[laengsschnitt.py]"]
  node_excel_writer["Workbook output<br/>[excel_writer.py]"]
end

node_user(("Engineer"))

node_user -->|"uses"| node_webapp
node_webapp -->|"requests"| node_api_client
node_api_client -.->|"calls"| node_server
node_server -->|"routes requests"| node_workspace
node_workspace -->|"uses"| node_pipeline
node_pipeline -->|"loads"| node_extract
node_user -->|"reviews project"| node_review
node_pipeline -->|"extracts soundings"| node_sounding
node_user -->|"calibrates plan"| node_viewer_location
node_webapp -->|"controls"| node_viewer_location
node_viewer_location -->|"shares viewer"| node_viewer
node_review -->|"interprets descriptions"| node_norms
node_pipeline -->|"uses"| node_units
node_pipeline -->|"builds model"| node_groundmodel
node_groundmodel -->|"uses"| node_units
node_groundmodel -->|"uses"| node_surfaces
node_groundmodel -->|"uses"| node_soilvalues
node_groundmodel -->|"exports IFC"| node_ifc
node_review -->|"uses"| node_homogeneous
node_homogeneous -->|"uses"| node_soilvalues
node_viewer -->|"displays model"| node_ifc
node_user -->|"requests comparison"| node_geoqueries
node_workspace -->|"queries services"| node_geoqueries
node_user -->|"loads terrain"| node_terrain
node_user -->|"loads buildings"| node_buildings
node_review -->|"exports reviewed data"| node_boreholeml
node_boreholeml -->|"uses codes"| node_norms
node_user -->|"runs export"| node_excel_app
node_excel_app -.->|"creates profile"| node_excel_profile
node_excel_app -.->|"creates section"| node_excel_section
node_excel_app -.->|"writes workbook"| node_excel_writer

click node_server "https://github.com/martinpazmino/groundtwin/blob/main/server/api.py"
click node_workspace "https://github.com/martinpazmino/groundtwin/blob/main/server/arbeitsplatz.py"
click node_pipeline "https://github.com/martinpazmino/groundtwin/blob/main/ui/pipeline.py"
click node_extract "https://github.com/martinpazmino/groundtwin/blob/main/services/extractor/prototyp_v4.py"
click node_review "https://github.com/martinpazmino/groundtwin/blob/main/ui/projekt.py"
click node_sounding "https://github.com/martinpazmino/groundtwin/blob/main/services/extractor/sondierungen.py"
click node_units "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/einheiten.py"
click node_norms "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/normen.py"
click node_surfaces "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/flaechen.py"
click node_groundmodel "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/modell.py"
click node_ifc "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/ifc4x3.py"
click node_homogeneous "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/homogenbereiche.py"
click node_soilvalues "https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/bodenkennwerte.py"
click node_geoqueries "https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/bohrdaten.py"
click node_boreholeml "https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/boreholeml.py"
click node_terrain "https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/gelaende.py"
click node_buildings "https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/gebaeude.py"
click node_webapp "https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/app/schritt_lage.ts"
click node_api_client "https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/app/api.ts"
click node_viewer "https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/viewer/viewer.ts"
click node_viewer_location "https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/viewer/lage.ts"
click node_excel_app "https://github.com/martinpazmino/groundtwin/blob/main/app.py"
click node_excel_profile "https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/bohrprofil.py"
click node_excel_section "https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/laengsschnitt.py"
click node_excel_writer "https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/excel_writer.py"

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_server,node_workspace,node_pipeline,node_extract,node_review,node_sounding toneBlue
class node_units,node_norms,node_surfaces,node_groundmodel,node_ifc,node_homogeneous,node_soilvalues toneAmber
class node_geoqueries,node_boreholeml,node_terrain,node_buildings toneMint
class node_webapp,node_api_client,node_viewer,node_viewer_location toneRose
class node_excel_app,node_excel_profile,node_excel_section,node_excel_writer,node_user toneIndigo
```

## Components

### Project workflow

- [HTTP API](https://github.com/martinpazmino/groundtwin/blob/main/server/api.py): `server/api.py`
- [Project workspace](https://github.com/martinpazmino/groundtwin/blob/main/server/arbeitsplatz.py): `server/arbeitsplatz.py`
- [Extraction pipeline](https://github.com/martinpazmino/groundtwin/blob/main/ui/pipeline.py): `ui/pipeline.py`
- [PDF extraction](https://github.com/martinpazmino/groundtwin/blob/main/services/extractor/prototyp_v4.py): `services/extractor/prototyp_v4.py`
- [Project review](https://github.com/martinpazmino/groundtwin/blob/main/ui/projekt.py): `ui/projekt.py`
- [Sounding extraction](https://github.com/martinpazmino/groundtwin/blob/main/services/extractor/sondierungen.py): `services/extractor/sondierungen.py`

### Ground modeling

- [Model units](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/einheiten.py): `services/modeler/baugrundmodell/einheiten.py`
- [Soil norms](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/normen.py): `services/modeler/baugrundmodell/normen.py`
- [Layer surfaces](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/flaechen.py): `services/modeler/baugrundmodell/flaechen.py`
- [Ground model](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/modell.py): `services/modeler/baugrundmodell/modell.py`
- [IFC export](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/ifc4x3.py): `services/modeler/baugrundmodell/ifc4x3.py`
- [Homogeneous zones](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/homogenbereiche.py): `services/modeler/baugrundmodell/homogenbereiche.py`
- [Soil parameters](https://github.com/martinpazmino/groundtwin/blob/main/services/modeler/baugrundmodell/bodenkennwerte.py): `services/modeler/baugrundmodell/bodenkennwerte.py`

### Geodata and exchange

- [State boreholes](https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/bohrdaten.py): `services/geodaten/geodaten/bohrdaten.py`
- [BoreholeML exchange](https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/boreholeml.py): `services/geodaten/geodaten/boreholeml.py`
- [Terrain and context](https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/gelaende.py): `services/geodaten/geodaten/gelaende.py`
- [3D buildings](https://github.com/martinpazmino/groundtwin/blob/main/services/geodaten/geodaten/gebaeude.py): `services/geodaten/geodaten/gebaeude.py`

### Web application

- [Step application](https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/app/schritt_lage.ts): `apps/web/src/app/schritt_lage.ts`
- [Web API client](https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/app/api.ts): `apps/web/src/app/api.ts`
- [IFC viewer](https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/viewer/viewer.ts): `apps/web/src/viewer/viewer.ts`
- [Plan location editor](https://github.com/martinpazmino/groundtwin/blob/main/apps/web/src/viewer/lage.ts): `apps/web/src/viewer/lage.ts`

### Excel export

- [Excel app](https://github.com/martinpazmino/groundtwin/blob/main/app.py): `app.py`
- [Borehole profile](https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/bohrprofil.py): `geo_agent/bohrprofil.py`
- [Longitudinal section](https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/laengsschnitt.py): `geo_agent/laengsschnitt.py`
- [Workbook output](https://github.com/martinpazmino/groundtwin/blob/main/geo_agent/excel_writer.py): `geo_agent/excel_writer.py`

### Other components

- **Engineer**

## Connections

- Engineer → Step application: uses (evidence: `README.md`)
- Step application → Web API client: requests (evidence: `apps/web/src/app/schritt_lage.ts`)
- Web API client → HTTP API: calls
- HTTP API → Project workspace: routes requests (evidence: `server/api.py`)
- Project workspace → Extraction pipeline: uses (evidence: `server/arbeitsplatz.py`)
- Extraction pipeline → PDF extraction: loads (evidence: `ui/pipeline.py`)
- Engineer → Project review: reviews project (evidence: `README.md`)
- Extraction pipeline → Sounding extraction: extracts soundings (evidence: `services/extractor/sondierungen.py`)
- Engineer → Plan location editor: calibrates plan (evidence: `README.md`)
- Step application → Plan location editor: controls (evidence: `apps/web/src/app/schritt_lage.ts`)
- Plan location editor → IFC viewer: shares viewer (evidence: `apps/web/src/viewer/lage.ts`)
- Project review → Soil norms: interprets descriptions (evidence: `ui/projekt.py`)
- Extraction pipeline → Model units: uses (evidence: `ui/pipeline.py`)
- Extraction pipeline → Ground model: builds model (evidence: `ui/pipeline.py`)
- Ground model → Model units: uses (evidence: `services/modeler/baugrundmodell/modell.py`)
- Ground model → Layer surfaces: uses (evidence: `services/modeler/baugrundmodell/modell.py`)
- Ground model → Soil parameters: uses (evidence: `services/modeler/baugrundmodell/modell.py`)
- Ground model → IFC export: exports IFC (evidence: `services/modeler/baugrundmodell/modell.py`)
- Project review → Homogeneous zones: uses (evidence: `ui/projekt.py`)
- Homogeneous zones → Soil parameters: uses (evidence: `services/modeler/baugrundmodell/homogenbereiche.py`)
- IFC viewer → IFC export: displays model (evidence: `README.md`)
- Engineer → State boreholes: requests comparison (evidence: `README.md`)
- Project workspace → State boreholes: queries services (evidence: `server/arbeitsplatz.py`)
- Engineer → Terrain and context: loads terrain (evidence: `README.md`)
- Engineer → 3D buildings: loads buildings (evidence: `README.md`)
- Project review → BoreholeML exchange: exports reviewed data (evidence: `README.md`)
- BoreholeML exchange → Soil norms: uses codes (evidence: `services/geodaten/geodaten/boreholeml.py`)
- Engineer → Excel app: runs export (evidence: `README.md`)
- Excel app → Borehole profile: creates profile
- Excel app → Longitudinal section: creates section
- Excel app → Workbook output: writes workbook
