https://github.com/aminehabchi/chaikin
three interactive graphical demonstrations built in Rust using the minifb window library.
https://github.com/aminehabchi/chaikin
chaikin-algorithm graphical-interface minifb radar rust snack
Last synced: 7 months ago
JSON representation
three interactive graphical demonstrations built in Rust using the minifb window library.
- Host: GitHub
- URL: https://github.com/aminehabchi/chaikin
- Owner: aminehabchi
- Created: 2025-05-20T10:52:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-05-21T21:09:53.000Z (9 months ago)
- Last Synced: 2025-06-23T12:43:59.271Z (8 months ago)
- Topics: chaikin-algorithm, graphical-interface, minifb, radar, rust, snack
- Language: Rust
- Homepage:
- Size: 81.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Rust Graphics Demonstrations with `minifb`
This repository showcases three interactive graphical demonstrations built in Rust using the [`minifb`](https://github.com/emoon/rust_minifb) window library.
## Included Demos
### 1. Chaikin's Curve Algorithm Animation
An interactive and animated implementation of Chaikin’s curve smoothing algorithm.
### 2. Radar Animation
A classic radar-style animation featuring a sweeping line and disappearing blips.
### 3. Snake Cursor Follower
A smooth snake-like animation that follows the user's cursor in real-time.
---
## Demonstrations
### Chaikin's Curve Algorithm

Chaikin's algorithm iteratively smooths a polyline by subdividing line segments, producing a curve-like effect.
**Features:**
- Place control points with **left mouse button**
- Start animation with **Enter**
- Runs through **7 refinement steps**
- Clear screen with **C**
- **Drag points** to move them
- Exit with **Esc**
---
### Radar Animation

A stylized radar simulation featuring:
**Features:**
- Rotating sweep line
- Random blips that fade over time
- Concentric range rings
- Exit with **Esc**
---
### Snake Cursor Follower

A fun snake-like follower that reacts to mouse movement.
**Features:**
- Smooth motion with physics-inspired spring behavior
- Segments follow each other with delay
- Exit with **Esc**
---
## Requirements
- Rust **1.50+**
- `cargo` package manager
---
## Installation
Clone this repository:
```bash
git clone https://github.com/aminehabchi/CHAIKIN.git
cd CHAIKIN
```
## Implementation Details
### Chaikin's Algorithm
Steps:
1. Users define a polyline by placing control points.
2. Each iteration replaces every segment AB with two points:
- One at **¼** of the way from A to B
- One at **¾** of the way from A to B
3. This is repeated for **7 iterations** to smooth the shape.
### Radar Animation
- Uses trigonometric rotation to animate a **sweeping line**
- **Blips** appear randomly and fade
- **Range rings** offer visual scale
### Snake Cursor Follower
- Uses **spring physics** for smooth trailing
- Segments track the one before it
- Real-time interaction with **mouse position**
---
## Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.