Skip to content
/ Cloth Public

A Python project that simulates a tearable cloth with gravity using Verlet Integration. Move your mouse across the fabric to tear it in real time. Perfect for learning physics simulation, game development, or experimenting with interactive graphics.

Notifications You must be signed in to change notification settings

hiu154/Cloth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧵 Cloth Simulation — Tearable Fabric (Python)

A real-time cloth physics simulation using Verlet Integration. Move your mouse to tear the fabric under gravity.


✨ Features

  • 🧲 Gravity & constraints: Cloth is made of connected particles with distance constraints for realistic physics.
  • ✂️ Mouse tearing: Drag your mouse over the cloth to break constraints and tear the fabric dynamically.
  • ⚖️ Stable physics: Uses Verlet Integration with multiple constraint iterations per frame.
  • ⚙️ Easy configuration: Adjust cloth size, spacing, gravity, tear radius, and iterations easily.

🖼 Demo

Replace with your own demo file after recording.

docs/demo.gif

Demo


📦 Installation

Requirements

  • Python 3.9+
  • OS: Windows / macOS / Ubuntu

Setup

git clone https://github.com/hiu154/Cloth.git


# Install dependencies
pip install -r requirements.txt

About

A Python project that simulates a tearable cloth with gravity using Verlet Integration. Move your mouse across the fabric to tear it in real time. Perfect for learning physics simulation, game development, or experimenting with interactive graphics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages