Skip to content

achnitreda/chaikin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Chaikin's Algorithm Implementation in Rust + Macroquad

A step-by-step animated implementation of Chaikin's corner-cutting subdivision algorithm for creating smooth curves from control points.

๐ŸŽฏ What is Chaikin's Algorithm?

Chaikin's algorithm is a corner-cutting subdivision technique that creates smooth curves from polygonal control points. It works by iteratively:

  1. Taking each edge between consecutive points
  2. Creating two new points at 25% and 75% positions along each edge
  3. Replacing the original polygon with these new points
  4. Repeating the process to create increasingly smooth curves

After 7 iterations, sharp corners become beautifully smooth curves!

๐ŸŽฎ Demo

Chaikin Algorithm Demo

Click to place control points, press Enter to watch the magic happen!

๐Ÿš€ Quick Start

Prerequisites

  • Rust 1.70+ installed
  • Cargo package manager

Dependencies

[dependencies]
macroquad = "0.4"

Build and Run

# Clone the repository
git clone https://github.com/achnitreda/chaikin.git
cd chaikin

# Run the application
cargo run --release

About

interactive visualization of Chaikin's algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages