Smoke Effect¶
See Water, smoke, cloth, and procedural worlds for presets, controls, units, and resize behavior.
Rising smoke or sinking ink, advected through an artistic curl field.
- class bruhanimate.bruheffect.smoke_effect.SmokeEffect(buffer: Buffer, background: str, settings: SmokeSettings | None = None)[source]¶
Bases:
BaseEffectDensity advection with clipped obstacles; not a pressure-solving fluid model.
Resize retains density and obstacles at the top-left and adds empty cells. Each update is one simulation tick; draw never moves or emits density.
- __init__(buffer: Buffer, background: str, settings: SmokeSettings | None = None) None[source]¶
Base class for all effects.
- Parameters:
buffer (Buffer) – Effect buffer to push updates to.
background (str) – character or string to use for the background.
seed – Non-negative integer for independent Python and NumPy random streams. None uses fresh entropy. Global RNG state is untouched.
- set_obstacles(cells: Iterable[tuple[int, int]]) None[source]¶
Replace solid local (x, y) cells; clip outside cells and clear their ink.
The iterable is copied immediately. Invalid coordinates leave the old mask unchanged. Obstacles prevent density transport through their cells.
- resize(size: tuple[int, int]) None[source]¶
Change the drawing viewport, retaining the original simulation raster.
Shrinking clips from the bottom/right; growing reveals the original raster again. Cells beyond it remain transparent to the owner. Random streams, resource handles and simulation coordinates are unchanged. Subclasses can override this typed hook to adapt simulation arrays and repaint the private raster at the current tick, then call super().resize. Built-in adapters use this contract; draw must still never advance time.