Skip to content

Repository files navigation

Rerun.NET

A cross-platform C# SDK for Rerun — multimodal data visualization for robotics, spatial AI, and computer vision.

Wraps the native rerun_c library via P/Invoke and the Arrow C Data Interface. All 45 archetypes, 79 components, and 61 datatypes are code-generated from the upstream FlatBuffers definitions, plus 67 blueprint types.

Quick Start

usingRerun.Net;usingRerun.Net.Archetypes;usingRerun.Net.Components;usingRerun.Net.Datatypes;usingvarrec=newRecordingStream("my_app");rec.Spawn();// or rec.Save("output.rrd");rec.Log("points",newPoints3D(newPosition3D(newVec3D([1f,2f,3f])),newPosition3D(newVec3D([4f,5f,6f]))).WithColors(newColor(newRgba32(0xFF0000FFu)),newColor(newRgba32(0x00FF00FFu))).WithRadii(newRadius(0.5f)));

Features

  • 100% archetype coverage — all 45 Rerun archetypes generated and working
  • Cross-language verified — 12 cross-language comparison tests confirm C# output is semantically identical to the Rust SDK
  • Cross-platform — targets win-x64, win-arm64, linux-x64, linux-arm64, osx-x64, osx-arm64
  • Code-generated — types stay in sync with Rerun via FlatBuffers .fbs codegen
  • TestableINativeApi interface allows mocking the native layer for unit tests without the native binary
  • 71 tests — 39 unit tests + 32 integration tests including backwards compatibility checks

Examples

ExampleDescription
MinimalExamplePoints3D with colors and radii over 2 frames
Minimal10x10x10 grid of 1000 colored points
ClockAnimated analog clock with Arrows3D
DNADouble helix with animated beads
GraphsGraph nodes, edges, lattice, Markov chain
PlotsGaussian, parabola, trig, classification scatter
ScalarPlotSin/cos/product scalar plots over time
RrtStarRRT* pathfinding algorithm visualization
MultithreadingThread-safe logging from 10 concurrent threads
IncrementalLoggingEfficient partial updates across frames
LiveScrollingPlot6 plots x 5 series random walk dashboard
GraphLattice10x10 lattice graph with directed edges
Arrows3DSpiral100 arrows in a spiral with gradient colors
LineStrips3DCubeWireframe cube with colored line strips
TextLoggingLog entries at different severity levels
ClearDemoLog arrows then clear them one by one

Run any example:

dotnet run --project examples/Graphs # saves to .rrd file
dotnet run --project examples/Graphs -- --spawn # opens Rerun viewer

Requirements

  • .NET 8.0+
  • Rust toolchain (to build rerun_c from source)

Building from Source

git clone --recursive https://github.com/KevinGliewe/Rerun.NET.git
cd Rerun.NET
# Build the native librarycd extern/rerun
cargo rustc -p rerun_c --release --crate-type cdylib
cd ../..
mkdir -p runtimes/win-x64/native # adjust RID for your platform
cp extern/rerun/target/release/rerun_c.dll runtimes/win-x64/native/
# Build and test the SDK
dotnet restore Rerun.Net.slnx
dotnet build Rerun.Net.slnx
dotnet test Rerun.Net.slnx

Optional: Build the Rerun CLI (for integration tests)

cd extern/rerun
cargo build -p rerun-cli --release --no-default-features

Run the code generator

dotnet run --project src/Rerun.Net.CodeGen -- \
extern/rerun/crates/store/re_sdk_types/definitions/rerun \
src/Rerun.Net

Architecture

Three-layer design mirroring the C++ SDK:

Layer 1 — Native/ P/Invoke bindings to rerun_c using .NET 8 LibraryImport (source-generated, AOT-compatible).

Layer 2 — Core/ Managed wrappers. RecordingStream wraps the native handle with IDisposable, provides Log(), TryLog(), sink configuration, timeline management, and SendColumns().

Layer 3 — Archetypes/Components/Datatypes/ Code-generated from FlatBuffers .fbs definitions. Archetypes implement IAsComponents, components implement ILoggable<T>.

License

MIT

About

C# SDK for rerun.io

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages