How bhom/bhom_engine works
Project type and purpose
• This is not a web app or database-backed system, but a monorepo of .NET/C# class-library projects that together form the “core engine” of the Buildings and Habitats object Model (BHoM).
• The README explains that each subproject (“Geometry_Engine”, “Spatial_Engine”, “Facade_Engine”, etc.) implements domain-specific processing functions for BHoM objects. Consumers (UIs, adapters, toolkits) reference these compiled assemblies or NuGet packages.
File structure
• Top‐level folders:
• <ci>: CI scripts, test datasets, build & packaging pipelines (AppVeyor, Azure DevOps, PowerShell).
• .github: templates and code‐owners.
• *.Engine subfolders: dozens of independent engine modules (each a .csproj library following a common folder layout: Compute, Create, Modify, Query, Objects, Convert).
• BHoM_Engine.sln: Visual Studio solution that ties all subprojects together.
• unit-tests, code: verification projects, solution files.
• Each engine project compiles into an assembly; they all reference a shared core (“BHoM_Engine” project) which provides base types (IObject, fragments, extension‐method runner), then domain modules add extension methods and algorithms.
• The CI folder holds JSON datasets for compliance tests, PowerShell scripts to build/test and .yml pipelines to orchestrate builds, unit tests, and NuGet packaging.
README insights
• The repo is the “Engine” layer of a larger ecosystem (other repos include the object definitions, adapters, UIs).
• There are links to documentation for how engines extend core objects via distributed extension-method algorithms.
• The build status badges show multi-stage CI (AppVeyor + Azure) culminating in a NuGet package.
a. Main components
• Core library (BHoM_Engine): defines shared types & the extension‐method execution engine.
• Domain engine libraries: Geometry_Engine, Spatial_Engine, Analytical_Engine, etc. (each a plugin implementing Compute/Create/Modify/Query).
• Test projects & datasets: unit-tests folder (C# test assemblies) and compliance datasets (.ci/Datasets JSON).
• CI/CD pipelines: .ci scripts & YAML definitions, AppVeyor + Azure DevOps.
b. Relationships and interactions
• CI pipelines trigger: clone → build solution → run unit tests using datasets → package domain and core into NuGet → publish.
c. Architectural patterns & design principles
• Modular plugin pattern: each domain is a separate assembly grouping related algorithms.
• Extension‐method dispatch: core engine uses reflection to discover and run Compute/Create/Modify/Query methods in domain modules.
• Separation of concerns: algorithms (Compute, Modify, Query) are distinguished by folder naming and interface conventions.
d. Key technologies, frameworks, libraries
• Language & runtime: C# targeting .NET Framework/Core.
• Build: MSBuild/Visual Studio solution (.sln, .csproj).
• CI/CD: AppVeyor & Azure DevOps pipelines, PowerShell scripts (.ps1), YAML definitions.
• Packaging: NuGet (.nuspec in .ci/Nuget).
• Testing: xUnit/NUnit (via Visual Studio .runsettings), JSON datasets for compliance tests.