Metaballs Effect¶
See Water, smoke, cloth, and procedural worlds for presets, controls, units, and resize behavior.
Smooth implicit blobs that merge and separate along independent orbits.
- class bruhanimate.bruheffect.metaballs_effect.MetaballsEffect(buffer: Buffer, background: str, settings: MetaballsSettings | None = None)[source]¶
Bases:
BaseEffectMoving isosurfaces, corrected for approximately 1:2 terminal cell aspect.
One update advances the orbital phase. Resize remaps the current orbits, retaining their seed and phase without consuming randomness.
- __init__(buffer: Buffer, background: str, settings: MetaballsSettings | 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.
- 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.