Simulation · Published v2

Amber Cascade

Two colors of grains fall onto a stepped basalt basin. Downward mass transport and empty-cell cleanup form a simple settling experiment. Paint GoldSand or RoseSand above the basin to keep the cascade going. Gold and rose colors identify the two grain models throughout their fall.

No preview

Inside this simulation

Every named building block is public and reusable. These are the exact versions published with this simulation.

Source

// This demonstration models vertical settling; it does not claim angle-of-repose physics.
property Grain { mass: Float<1.0> [0.0 1.0]; tint: Float<0.0> [0.0 1.0]; }
property Rock { hardness: Float<1.0> [0.0 1.0]; }
model Basin : Rock;
model GoldSand : Grain;
model RoseSand : Grain { tint<1.0>; };
world { dimensions 3; cell Cube; neighborhood VonNeumann; }
behavior Fall for Grain { stream self.mass toward -Z when exposed[-Z] on block reflect into self.mass; }
behavior RemoveEmptyGrain for Grain { delete when self.mass < 0.01; }
phase gravity { run Fall on GoldSand; run Fall on RoseSand; }
phase cleanup { run RemoveEmptyGrain on GoldSand; run RemoveEmptyGrain on RoseSand; }
visual Basalt for Rock { color { rgba(0.18, 0.23, 0.31, 1.0) } }
visual GoldGlow for Grain { color { rgba(0.96, 0.68, 0.18, 1.0) } }
visual RoseGlow for Grain { color { rgba(0.96, 0.33, 0.46, 1.0) } }
visualize Basin with Basalt;
visualize GoldSand with GoldGlow;
visualize RoseSand with RoseGlow;