-
Notifications
You must be signed in to change notification settings - Fork 13
brain_render_worker.py
An offscreen rendering engine running in its own QThread that paints the entire brain visualization to a QImage buffer. The main thread simply blits this cached image during paintEvent, dramatically improving UI responsiveness. The worker receives immutable state snapshots and handles all the complex drawing logic—connections with animated pulses, neurons with various shapes, localized labels, and visual effects for learning events.
- Immutable snapshot containing positions, states, colors, weights, and animation parameters
- Created on main thread via
create_render_state_from_widget()helper - Includes pre-calculated localized neuron labels to avoid i18n lookups during render
request_render(state) — throttled to ~10 FPS maximum
Draws connections with pulse effects, weight-based thickness, and directional indicators
Draws neurons as circles, polygons, or special connector shapes
Handles hover highlights and Hebbian animation effects
####Animation Support:
- Traveling activation pulses along connections
- Ambient pulsing based on connection weight
- Communication glow packets for activity visualization
- Weight change animations highlighting Hebbian learning updates
🦑 Raise digital squids whose brains grow & rewire themselves through Hebbian learning and Neurogenesis