← f_ notebook · Mirrors · PDE

f_vf_ch, live ​

A Cahn-Hilliard phase field decides pixel by pixel which of two flows shows. The phases bead into droplets, coalesce, and keep a crisp boundary instead of smearing; bright parts of the image deposit one phase.

The cell below steps the NumPy mirror that f_vf_ch's tests are written against, in your browser. It is the NumPy mirror, not the Max patch, and it is not claimed to match the patch bit for bit.

f_vf_ch · NumPy mirror (Pyodide) · not the Max patch
Downloads about 15 MB the first time (Python and NumPy).
  • coarsen is how fast the phases pull together into bigger blobs (mobility, cubic in the dial); 0 means the pattern is only carried, never re-formed.
  • inject is how strongly bright parts of the second input deposit phase B (rate cubic in the dial).
  • advection is how far the pattern is carried by the blended flow each frame; 0 freezes it in place.
  • edge width sets the width of the boundary between the phases, in solver texels: small is crisp, large is a soft blend zone.
  • mix biases which flow the picture moves like: 0 everything moves like phase A, 100 like phase B, 50 the phase field decides.
  • balance relaxes the overall amount of phase B toward fill, mostly visible over long runs with a held-on source; 0 turns it off.
  • fill is the mean phase at reset and the balance point: negative is mostly phase A, positive mostly phase B.
  • view shows the phase pattern (dark one phase, light the other) or the blended velocity as color by direction, value by speed.
  • The input select picks velocity phase A (swirl, shear, uniform, curl noise, or a moving swirl); the paired second input is the image that injects phase B.
  • Reseed starts again from new noise: the pattern begins faint and separates into droplets over the first dozen or so frames.

reference doc · idea note · patcher · vf_ch_mirror.py

← WavetableComplex Ginzburg-Landau →