# ebrahimraeyat/civiltools architecture

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

- Interactive diagram: https://gitdiagram.com/ebrahimraeyat/civiltools
- Repository: https://github.com/ebrahimraeyat/civiltools

## Overview

civilTools is a FreeCAD-oriented collection of civil-engineering utilities, including ETABS model workflows, seismic calculations, section analysis, and CAD/document exchange. A visible example workflow starts with a user command, opens a diaphragm-forces form, loads project settings, computes factors, and asks the ETABS model to create story files. Other documented capabilities include combined-steel-section conversion and Iranian seismic coefficient calculation. The graph preserves major code and data subsystems; several feature links rely on the source index or README because their implementations were not sampled.

Main entry points: [`section/sectionproperties/analysis/cross_section.py`](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/analysis/cross_section.py) (Cross-section analysis), [`py_widget/define/create_load_combinations.py`](https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/define/create_load_combinations.py) (Load combinations), [`exporter/civiltools_config.py`](https://github.com/ebrahimraeyat/civiltools/blob/master/exporter/civiltools_config.py) (Project settings), [`gui_civiltools/control/gui_diaphragm_applied_forces.py`](https://github.com/ebrahimraeyat/civiltools/blob/master/gui_civiltools/control/gui_diaphragm_applied_forces.py) (Diaphragm command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model_tools["Model tools"]
  node_diaphragm_command["Diaphragm command"]
  node_diaphragm_form["Diaphragm forces"]
  node_project_settings["Project settings"]
  node_building_calcs["Building seismic model<br/>[build.py]"]
  node_load_combinations_ui["Load combinations UI"]
  node_load_combinations["Load combinations"]
end

subgraph group_section_analysis["Section analysis"]
  node_combined_sections["Combined section conversion<br/>[sec.py]"]
  node_section_geometry["Section geometry<br/>[sections.py]"]
  node_section_preprocess["Mesh preprocessing<br/>[pre.py]"]
  node_section_analysis_core["Finite element analysis<br/>[fea.py]"]
  node_cross_section["Cross-section analysis<br/>[cross_section.py]"]
  node_section_post["Section results<br/>[post.py]"]
end

subgraph group_cad_exchange["CAD exchange"]
  node_dxf_reader["DXF reader<br/>[dxfReader.py]"]
  node_dxf_entities["DXF entities"]
  node_dxf_importer["FreeCAD DXF import<br/>[dxf_funcs.py]"]
  node_pdf_export_ui["DWG-to-PDF workflow"]
  node_pdf_export["DWG-to-PDF export<br/>[dwg_to_pdf.py]"]
end

subgraph group_shared_data["Shared data"]
  node_soil_tables[("Soil tables<br/>[soil.py]")]
  node_system_factors[("System factors<br/>[RuTable.py]")]
  node_regional_data[("Regional city data<br/>[ostanha.py]")]
  node_table_models["Engineering table models<br/>[table_model.py]"]
  node_civiltools_resources["CivilTools resources<br/>[civiltools_rc.py]"]
end

node_freecad_user(("FreeCAD user"))
node_etabs_model["ETABS model"]
node_autocad["AutoCAD"]

node_freecad_user -->|"invokes"| node_diaphragm_command
node_diaphragm_command -->|"opens"| node_diaphragm_form
node_diaphragm_command -->|"loads settings"| node_project_settings
node_diaphragm_form -->|"loads configuration"| node_project_settings
node_diaphragm_form -->|"creates story files"| node_etabs_model
node_project_settings -->|"constructs building"| node_building_calcs
node_building_calcs -->|"uses soil data"| node_soil_tables
node_building_calcs -->|"uses system factors"| node_system_factors
node_freecad_user -.->|"invokes"| node_load_combinations_ui
node_load_combinations_ui -->|"opens workflow"| node_load_combinations
node_load_combinations_ui -->|"loads settings"| node_project_settings
node_load_combinations -->|"updates combinations"| node_etabs_model
node_load_combinations -->|"reads regional data"| node_regional_data
node_load_combinations -->|"uses table models"| node_table_models
node_freecad_user -.->|"uses tool"| node_combined_sections
node_cross_section -->|"uses geometry"| node_section_geometry
node_cross_section -->|"uses mesh"| node_section_preprocess
node_cross_section -->|"uses analysis"| node_section_analysis_core
node_cross_section -->|"uses results"| node_section_post
node_freecad_user -.->|"imports drawing"| node_dxf_importer
node_dxf_importer -->|"uses reader"| node_dxf_reader
node_dxf_reader -->|"wraps entities"| node_dxf_entities
node_freecad_user -.->|"starts export"| node_pdf_export_ui
node_pdf_export_ui -->|"runs exporter"| node_pdf_export
node_pdf_export -->|"controls"| node_autocad

click node_diaphragm_command "https://github.com/ebrahimraeyat/civiltools/blob/master/gui_civiltools/control/gui_diaphragm_applied_forces.py"
click node_diaphragm_form "https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/control/diaphragm_applied_forces.py"
click node_project_settings "https://github.com/ebrahimraeyat/civiltools/blob/master/exporter/civiltools_config.py"
click node_building_calcs "https://github.com/ebrahimraeyat/civiltools/blob/master/building/build.py"
click node_soil_tables "https://github.com/ebrahimraeyat/civiltools/blob/master/building/soil.py"
click node_system_factors "https://github.com/ebrahimraeyat/civiltools/blob/master/building/RuTable.py"
click node_load_combinations_ui "https://github.com/ebrahimraeyat/civiltools/blob/master/gui_civiltools/define/gui_create_load_combinations.py"
click node_load_combinations "https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/define/create_load_combinations.py"
click node_regional_data "https://github.com/ebrahimraeyat/civiltools/blob/master/db/ostanha.py"
click node_table_models "https://github.com/ebrahimraeyat/civiltools/blob/master/table_model.py"
click node_combined_sections "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sec.py"
click node_section_geometry "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/pre/sections.py"
click node_section_preprocess "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/pre/pre.py"
click node_section_analysis_core "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/analysis/fea.py"
click node_cross_section "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/analysis/cross_section.py"
click node_section_post "https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/post/post.py"
click node_dxf_reader "https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_obj/dxfReader.py"
click node_dxf_entities "https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_obj/dxfImportObjects.py"
click node_dxf_importer "https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_py/dxf_funcs.py"
click node_pdf_export_ui "https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/import_export/export_dwg_to_pdf.py"
click node_pdf_export "https://github.com/ebrahimraeyat/civiltools/blob/master/functions/dwg_to_pdf.py"
click node_civiltools_resources "https://github.com/ebrahimraeyat/civiltools/blob/master/civiltools_rc.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_diaphragm_command,node_diaphragm_form,node_project_settings,node_building_calcs,node_load_combinations_ui,node_load_combinations,node_freecad_user toneBlue
class node_combined_sections,node_section_geometry,node_section_preprocess,node_section_analysis_core,node_cross_section,node_section_post toneAmber
class node_dxf_reader,node_dxf_entities,node_dxf_importer,node_pdf_export_ui,node_pdf_export toneMint
class node_soil_tables,node_system_factors,node_regional_data,node_table_models,node_civiltools_resources toneRose
class node_etabs_model,node_autocad toneIndigo
```

## Components

### Model tools

- [Diaphragm command](https://github.com/ebrahimraeyat/civiltools/blob/master/gui_civiltools/control/gui_diaphragm_applied_forces.py): `gui_civiltools/control/gui_diaphragm_applied_forces.py`
- [Diaphragm forces](https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/control/diaphragm_applied_forces.py): `py_widget/control/diaphragm_applied_forces.py`
- [Project settings](https://github.com/ebrahimraeyat/civiltools/blob/master/exporter/civiltools_config.py): `exporter/civiltools_config.py`
- [Building seismic model](https://github.com/ebrahimraeyat/civiltools/blob/master/building/build.py): `building/build.py`
- [Load combinations UI](https://github.com/ebrahimraeyat/civiltools/blob/master/gui_civiltools/define/gui_create_load_combinations.py): `gui_civiltools/define/gui_create_load_combinations.py`
- [Load combinations](https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/define/create_load_combinations.py): `py_widget/define/create_load_combinations.py`

### Section analysis

- [Combined section conversion](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sec.py): `section/sec.py`
- [Section geometry](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/pre/sections.py): `section/sectionproperties/pre/sections.py`
- [Mesh preprocessing](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/pre/pre.py): `section/sectionproperties/pre/pre.py`
- [Finite element analysis](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/analysis/fea.py): `section/sectionproperties/analysis/fea.py`
- [Cross-section analysis](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/analysis/cross_section.py): `section/sectionproperties/analysis/cross_section.py`
- [Section results](https://github.com/ebrahimraeyat/civiltools/blob/master/section/sectionproperties/post/post.py): `section/sectionproperties/post/post.py`

### CAD exchange

- [DXF reader](https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_obj/dxfReader.py): `freecad_obj/dxfReader.py`
- [DXF entities](https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_obj/dxfImportObjects.py): `freecad_obj/dxfImportObjects.py`
- [FreeCAD DXF import](https://github.com/ebrahimraeyat/civiltools/blob/master/freecad_py/dxf_funcs.py): `freecad_py/dxf_funcs.py`
- [DWG-to-PDF workflow](https://github.com/ebrahimraeyat/civiltools/blob/master/py_widget/import_export/export_dwg_to_pdf.py): `py_widget/import_export/export_dwg_to_pdf.py`
- [DWG-to-PDF export](https://github.com/ebrahimraeyat/civiltools/blob/master/functions/dwg_to_pdf.py): `functions/dwg_to_pdf.py`

### Shared data

- [Soil tables](https://github.com/ebrahimraeyat/civiltools/blob/master/building/soil.py): `building/soil.py`
- [System factors](https://github.com/ebrahimraeyat/civiltools/blob/master/building/RuTable.py): `building/RuTable.py`
- [Regional city data](https://github.com/ebrahimraeyat/civiltools/blob/master/db/ostanha.py): `db/ostanha.py`
- [Engineering table models](https://github.com/ebrahimraeyat/civiltools/blob/master/table_model.py): `table_model.py`
- [CivilTools resources](https://github.com/ebrahimraeyat/civiltools/blob/master/civiltools_rc.py): `civiltools_rc.py`

### Other components

- **FreeCAD user**
- **ETABS model**
- **AutoCAD**

## Connections

- FreeCAD user → Diaphragm command: invokes (evidence: `gui_civiltools/control/gui_diaphragm_applied_forces.py`)
- Diaphragm command → Diaphragm forces: opens (evidence: `gui_civiltools/control/gui_diaphragm_applied_forces.py`)
- Diaphragm command → Project settings: loads settings (evidence: `gui_civiltools/control/gui_diaphragm_applied_forces.py`)
- Diaphragm forces → Project settings: loads configuration (evidence: `py_widget/control/diaphragm_applied_forces.py`)
- Diaphragm forces → ETABS model: creates story files (evidence: `py_widget/control/diaphragm_applied_forces.py`)
- Project settings → Building seismic model: constructs building (evidence: `exporter/civiltools_config.py`)
- Building seismic model → Soil tables: uses soil data (evidence: `building/build.py`)
- Building seismic model → System factors: uses system factors (evidence: `building/build.py`)
- FreeCAD user → Load combinations UI: invokes
- Load combinations UI → Load combinations: opens workflow (evidence: `gui_civiltools/define/gui_create_load_combinations.py`)
- Load combinations UI → Project settings: loads settings (evidence: `gui_civiltools/define/gui_create_load_combinations.py`)
- Load combinations → ETABS model: updates combinations (evidence: `py_widget/define/create_load_combinations.py`)
- Load combinations → Regional city data: reads regional data (evidence: `py_widget/define/create_load_combinations.py`)
- Load combinations → Engineering table models: uses table models (evidence: `py_widget/define/create_load_combinations.py`)
- FreeCAD user → Combined section conversion: uses tool
- Cross-section analysis → Section geometry: uses geometry (evidence: `section/sectionproperties/analysis/cross_section.py`)
- Cross-section analysis → Mesh preprocessing: uses mesh (evidence: `section/sectionproperties/analysis/cross_section.py`)
- Cross-section analysis → Finite element analysis: uses analysis (evidence: `section/sectionproperties/analysis/cross_section.py`)
- Cross-section analysis → Section results: uses results (evidence: `section/sectionproperties/analysis/cross_section.py`)
- FreeCAD user → FreeCAD DXF import: imports drawing
- FreeCAD DXF import → DXF reader: uses reader (evidence: `freecad_py/dxf_funcs.py`)
- DXF reader → DXF entities: wraps entities (evidence: `freecad_obj/dxfReader.py`)
- FreeCAD user → DWG-to-PDF workflow: starts export
- DWG-to-PDF workflow → DWG-to-PDF export: runs exporter (evidence: `py_widget/import_export/export_dwg_to_pdf.py`)
- DWG-to-PDF export → AutoCAD: controls (evidence: `functions/dwg_to_pdf.py`)
