How nidhikhare12/osdagbridge works
Purpose and Entry Points
OsdagBridge is a Python bridge-analysis/design application with a shared computational core and multiple presentation interfaces. Plate girder is the materially implemented bridge type; box-girder and truss packages establish the extension shape.
• CLI entry point: src/osdagbridge/cli/__main__.py, command wiring in src/osdagbridge/cli/commands.py.
• Desktop entry point: src/osdagbridge/desktop/__main__.py.
• Separate web skeleton: web/backend/manage.py and web/frontend/src/App.jsx.
Shared Core and Bridge-Type Boundary
src/osdagbridge/core/ owns engineering logic, while interfaces should invoke it rather than duplicate calculations. Bridge types package their workflow-specific models and orchestration.
• Plate-girder workflow: src/osdagbridge/core/bridge_types/plate_girder/designer.py, src/osdagbridge/core/bridge_types/plate_girder/analyser.py, src/osdagbridge/core/bridge_types/plate_girder/dto.py.
• Future-type templates follow the same phases: src/osdagbridge/core/bridge_types/box_girder/, src/osdagbridge/core/bridge_types/truss/.
• Plate-girder-specific graph/control orchestration is concentrated in src/osdagbridge/core/bridge_types/plate_girder/graph_engine.py.
Primary Design and Analysis Flow
Input is modeled/validated, initially sized, converted into bridge geometry and loading, analyzed through a selected solver, then post-processed for design checks and presentation artifacts.
1. Validate and normalize project input: src/osdagbridge/core/bridge_types/plate_girder/validator.py.
2. Establish candidate dimensions and bridge representation: src/osdagbridge/core/bridge_types/plate_girder/initial_sizing.py, src/osdagbridge/core/bridge_types/plate_girder/bridge_geometry.py.
3. Place loads and configure analysis: src/osdagbridge/core/bridge_types/plate_girder/load_placement.py, src/osdagbridge/core/loads/vehicle.py.
4. Produce analysis results and design decisions: src/osdagbridge/core/bridge_types/plate_girder/analysis_results.py, src/osdagbridge/core/bridge_types/plate_girder/designer.py.
5. Transform results for UI/reports: src/osdagbridge/core/bridge_types/plate_girder/results_data_post_processing.py.
Solver Abstraction and Analysis Runtime
Analysis is isolated behind solver adapters, allowing runtime backend selection without changing bridge-type workflow code.
• Native solver: src/osdagbridge/core/solvers/native_solver.py.
• OpenSees integration boundary: src/osdagbridge/core/solvers/opensees_adapter.py.
• OspGrillage integration boundary: src/osdagbridge/core/solvers/ospgrillage_adapter.py.
• The repository also vendors an ospgrillage Python implementation under src/ospgrillage/, notably src/ospgrillage/osp_grillage.py and src/ospgrillage/mesh.py.
Reusable Physical Components and Standards
Bridge-type orchestration composes reusable component geometry, properties, builders, and checks. Indian-standard modules centralize code factors, load rules, and checks rather than embedding them in UI layers.
• Plate-girder component rules: src/osdagbridge/core/bridge_components/super_structure/plate_girder/checks.py, src/osdagbridge/core/bridge_components/super_structure/plate_girder/geometry.py.
• Deck and bracing composition: src/osdagbridge/core/bridge_components/super_structure/deck/builder.py, src/osdagbridge/core/bridge_components/super_structure/cross_bracing/builder.py.
• Code registry and major standards: src/osdagbridge/core/utils/codes/registry.py, src/osdagbridge/core/utils/codes/irc6_2017.py, src/osdagbridge/core/utils/codes/is800_2007.py.
Outputs, CAD, and Local Reference Data
Analysis/design outputs branch into bills of quantities, reports, CAD/IFC export, plots, and desktop visualizations.
• Report assembly is centralized in src/osdagbridge/core/reports/report_generator.py, with a LaTeX template at src/osdagbridge/core/reports/templates/default_template.tex.
• CAD and IFC export boundaries: src/osdagbridge/core/bridge_types/plate_girder/cad_generator.py, src/osdagbridge/core/ifc_export_bridge/export_ifc_handler.py.
• BOQ generation: src/osdagbridge/core/boq/boq_generator.py.
• Project-location lookup uses bundled SQLite, GeoJSON, and zone shapefiles: src/osdagbridge/core/data/project_location/database.py, src/osdagbridge/core/data/project_location/zone_lookup.py.
Desktop and Distribution
The desktop runtime is a PySide6-oriented UI layer with input/output docks, dialogs, plotting, and CAD views over the core workflow.
• Main interface surfaces: src/osdagbridge/desktop/ui/docks/input_dock.py, src/osdagbridge/desktop/ui/docks/output_dock.py, src/osdagbridge/desktop/ui/cad_3d.py.
• Conda packaging and desktop installer construction are first-class distribution infrastructure: conda-recipe/meta.yaml, constructor/construct.yaml.
Components 20
Interfaces
- CLI
src/osdagbridge/cli/__main__.py - Desktop UI · Input/output docks and CAD views invoke the shared workflow.
src/osdagbridge/desktop/__main__.py - Web skeleton
web/backend/manage.py
Plate-Girder Workflow
- Plate girder orchestrator · Coordinates the implemented bridge design and analysis flow.
src/osdagbridge/core/bridge_types/plate_girder/graph_engine.py - Input validation
src/osdagbridge/core/bridge_types/plate_girder/validator.py - Sizing & geometry
src/osdagbridge/core/bridge_types/plate_girder/initial_sizing.py - Load placement
src/osdagbridge/core/bridge_types/plate_girder/load_placement.py - Analysis & design
src/osdagbridge/core/bridge_types/plate_girder/designer.py - Result post-processing
src/osdagbridge/core/bridge_types/plate_girder/results_data_post_processing.py
Shared Engineering Core
- Bridge components · Composes girder, deck, and cross-bracing rules.
src/osdagbridge/core/bridge_components/super_structure/plate_girder/checks.py - Indian standards · Centralizes load rules, factors, and design checks.
src/osdagbridge/core/utils/codes/registry.py - Project location data · Uses bundled SQLite, GeoJSON, and zone data.
src/osdagbridge/core/data/project_location/database.py - Future bridge types · Box-girder and truss packages follow the same phase structure.
Solver Runtime
- Solver adapters · Keeps solver choice outside bridge-type workflow code.
src/osdagbridge/core/solvers/opensees_adapter.py - Native solver
src/osdagbridge/core/solvers/native_solver.py - Vendored OspGrillage
src/ospgrillage/osp_grillage.py
Outputs & Distribution
- Reports · Generates reports from design results and templates.
src/osdagbridge/core/reports/report_generator.py - BOQ generation
src/osdagbridge/core/boq/boq_generator.py - CAD & IFC export
src/osdagbridge/core/bridge_types/plate_girder/cad_generator.py - Desktop distribution
constructor/construct.yaml
Connections 20
- CLI → Plate girder orchestrator: invokes
- Desktop UI → Plate girder orchestrator: invokes
- Web skeleton → Plate girder orchestrator: intended core consumer
- Desktop distribution → Desktop UI: packages
- Plate girder orchestrator → Input validation: validates input
- Input validation → Sizing & geometry: normalized project
- Sizing & geometry → Load placement: bridge representation
- Load placement → Analysis & design: configured model
- Analysis & design → Result post-processing: design results
- Sizing & geometry → Bridge components: composes
- Load placement → Indian standards: load rules
- Analysis & design → Indian standards: code checks
- Analysis & design → Solver adapters: selects backend
- Solver adapters → Native solver: native path
- Solver adapters → Vendored OspGrillage: OspGrillage path
- Result post-processing → Reports: report data
- Result post-processing → BOQ generation: quantities
- Result post-processing → CAD & IFC export: export model
- Plate girder orchestrator → Project location data: location lookup
- Future bridge types → Plate girder orchestrator: mirrors workflow shape