System Architecture

The three-layer structure behind Balarhinos.

Balarhinos is built on a robust three-layer architecture designed for performance, portability, and maintainability.

The Three Layers

Balarhinos separates concerns into three distinct layers:

Layer 3: UI (Next.js / React / TypeScript)

The user interface is a modern web application running inside Rhino via WebView2. It handles semantic tagging dashboards, analysis controls, and real-time monitoring.

Layer 2: Intelligence Kernel (C# / RhinoCommon)

The core logic of the plugin lives in C#. This layer manages the dependency graph, urban metrics services, and orchestrates the various systems like plot division.

Layer 1: Native Engine (C++ / OptiX / CUDA)

For computationally heavy tasks like ray tracing, Balarhinos uses a high-performance native engine. This C++ layer communicates directly with the GPU to provide real-time occlusion and context testing.

Data Flow

Communication between these layers is optimized for speed:

  1. UI ↔ Plugin: A high-speed asynchronous bridge (<100ms) handles typed messages between the Next.js UI and the C# kernel.
  2. Plugin ↔ Native: P/Invoke is used to pass geometry and analysis parameters to the OptiX ray tracing engine.
graph TD
    UI[Layer 3: UI Next.js/React] -->|WebView2 Bridge| Plugin[Layer 2: C# Intelligence Kernel]
    Plugin -->|P/Invoke| Native[Layer 1: OptiX/CUDA Native]

Technology Stack

LayerTechnologyVersion
UINext.js, React, TypeScript16.x, 19.x, 5.x
PluginC# .NET, RhinoCommon8.0, Rhino 8
NativeOptiX, CUDA8.1.0, 12.9
BridgeWebView2Latest

Performance Targets

We prioritize responsiveness above all else:

  • Bridge Communication: <100ms
  • Incremental System Update: <100ms
  • Urban Metrics Calculation: <50ms
  • OptiX Sun Study (Live): Real-time (FPS dependent on GPU)