Skip to content

CPU structural solver

A pure-C# truss that loads, fails, and collapses

A pure-C# structural showcase from the GameDevelopment.BridgeBuilder leaf. A real truss solver computes axial forces and per-member utilisation as the load ramps up - members shade from green to red as they near capacity. Then, when a member fails, a position-based-dynamics collapse simulator (Verlet integration with distance constraints) drops the snapped member and the deck sags under gravity. All on the .NET base library, with zero dependencies - the frames become the images below.

23
members
green to red
stress scale
6.8 m
collapse sag
0
NuGet packages
An animated Warren truss loaded until a member fails, then the failed span hinges down into a deep sag
Load then collapse
Full sequence

A 6-panel Warren truss loaded by the real TrussSolver (colours ramp with utilisation), then the CollapseSimulator hinges the failed span down into a deep sag.

A Warren truss at its failure load, each member tinted by stress from tension green to hot orange and red
Stress colours
Near failure

At the failure load each member is tinted by its utilisation - the bottom chord in tension green, the top chord and diagonals in hot orange and red.

The truss after collapse, the snapped member removed and the deck folded into a hanging catenary pinned at both abutments
Position-based dynamics
Collapsed

The snapped member (thin red) is removed and Verlet distance constraints let the deck fold into a hanging catenary under gravity, pinned at both abutments.

How it works

The truss solver assembles joint equilibrium and solves the member axial forces, dividing each by its section capacity - Euler buckling in compression, yield in tension - to get a utilisation ratio; the renderer colours each member by that ratio. On failure the collapse simulator treats joints as particles and intact members as stiff distance constraints, integrates gravity with Verlet, and relaxes the constraints each step - so the freed mechanism swings down realistically. Plain C# on the base library, portable by transliteration and free of any external dependency.