Physics Sandbox
A real-time 3D physics simulation built as an F# microservices architecture, orchestrated by .NET Aspire 13.2. Create bodies with 10 shape types, connect them with 10 constraint types, cast rays, toggle debug wireframes, record and replay sessions, and watch the results in a live 3D viewer — all controlled through a REPL client, scripting (F# and Python), or AI assistants via MCP.
Architecture
Five services communicate through a central gRPC hub:
graph TD
Server["Server\n(gRPC Hub)"]
Sim["Simulation\n(BepuPhysics2)"]
Viewer["3D Viewer\n(Stride3D)"]
Client["REPL Client\n(Spectre.Console)"]
MCP["MCP Server\n(59 AI Tools)"]
Server <-->|"commands / state\nbidirectional stream"| Sim
Client -->|"commands\nview commands"| Server
Server -->|"state stream"| Client
Server -->|"state stream\nview commands"| Viewer
MCP -->|"commands"| Server
Server -->|"state stream"| MCP
Documentation
- *Getting Started* — Build, run, and interact with the sandbox (includes container option)
- *Release: Stride BepuPhysics Integration* — 10 shapes, constraints, queries, debug viz, per-body color
- *Architecture* — Service design, data flow, and gRPC contracts
- *Scripting Library* — Convenience library for F# script authors
- *Demo Scripts* — 22 physics demos in F# and Python
- *MCP Tools* — 59 tools for AI-assisted physics debugging
- *Known Issues* — Current limitations and workarounds
- *Test Suite* — 467 tests across 7 projects
- *Python API Reference* — Python prelude library: session, bodies, camera, queries, batching
- *API Reference* — PhysicsSandbox.Scripting module documentation
PhysicsSandbox