Skip to content

fihry/chaikin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chaikin Curve Animation

Overview

This project lets you draw points on a canvas and visualize a curve generated by Chaikin's algorithm. The curve is smoothed step by step, and the animation runs for 7 steps before restarting.

Features

Click to Add Points: Click on the canvas to add control points.

  • Animation: Press Enter to start the animation and smooth the curve.

  • Clear Points: Press Delete to remove all points.

  • Exit: Press Escape to close the app.

Requirements

  • Rust: Install Rust from here.

  • macroquad crate: Used for window handling and rendering.

How to Run

Create a new Rust project:

Copy
Edit
cargo new chaikin_curve
cd chaikin_curve
Add macroquad to Cargo.toml:
[dependencies]
macroquad = "0.3"
Replace the contents of src/main.rs with the provided code.

Run the project:

cargo run
Usage
Click on the canvas to place control points.
  • Press Enter to start the animation and smooth the curve.

  • Press Delete to clear all points.

  • Press Escape to exit the app.

Chaikin's Algorithm Chaikin’s algorithm smooths the curve by generating new points between each pair of existing points. The process is repeated for 7 steps to refine the curve.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages