Diffusion Effect¶

Copyright 2023 Ethan Christensen

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class bruhanimate.bruheffect.diffusion_effect.DiffusionEffect(buffer: Buffer, background: str, settings: DiffusionSettings = None)[source]¶

Bases: BaseEffect

Gray-Scott reaction-diffusion simulation.

Two virtual chemicals U and V interact according to the Gray-Scott model, producing organic-looking spots, stripes, and coral patterns that evolve continuously. Default parameters (f=0.055, k=0.062) sit in the coral/worm-pattern regime; adjust them to explore the full parameter space.

Multiple simulation steps run per rendered frame so the pattern evolves fast enough to be visually interesting.

__init__(buffer: Buffer, background: str, settings: DiffusionSettings = 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.

set_parameters(f: float = None, k: float = None)[source]¶

Update the feed (f) and/or kill (k) rate at runtime.

render_frame(frame_number: int)[source]¶

To be defined by each effect.