A step-by-step animated implementation of Chaikin's corner-cutting subdivision algorithm for creating smooth curves from control points.
Chaikin's algorithm is a corner-cutting subdivision technique that creates smooth curves from polygonal control points. It works by iteratively:
- Taking each edge between consecutive points
- Creating two new points at 25% and 75% positions along each edge
- Replacing the original polygon with these new points
- Repeating the process to create increasingly smooth curves
After 7 iterations, sharp corners become beautifully smooth curves!
Click to place control points, press Enter to watch the magic happen!
- Rust 1.70+ installed
- Cargo package manager
[dependencies]
macroquad = "0.4"
# Clone the repository
git clone https://github.com/achnitreda/chaikin.git
cd chaikin
# Run the application
cargo run --release