{"id":17189126,"url":"https://github.com/esimov/cloth-physics","last_synced_at":"2025-03-22T18:34:12.626Z","repository":{"id":65198722,"uuid":"577825657","full_name":"esimov/cloth-physics","owner":"esimov","description":"Desktop application for cloth physics simulation using Gio GUI.","archived":false,"fork":false,"pushed_at":"2024-03-06T11:28:41.000Z","size":190326,"stargazers_count":37,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-16T01:10:49.216Z","etag":null,"topics":["cloth","cloth-simulation","desktop-app","gio","go","golang","math","physics","simulation","verlet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esimov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-13T16:01:12.000Z","updated_at":"2024-09-10T16:13:33.000Z","dependencies_parsed_at":"2024-06-19T02:07:08.775Z","dependency_job_id":null,"html_url":"https://github.com/esimov/cloth-physics","commit_stats":{"total_commits":92,"total_committers":6,"mean_commits":"15.333333333333334","dds":0.07608695652173914,"last_synced_commit":"af1ebcd32487def1f39aa05d1da2db7faab3687e"},"previous_names":["esimov/gio-cloth"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcloth-physics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcloth-physics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcloth-physics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimov%2Fcloth-physics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esimov","download_url":"https://codeload.github.com/esimov/cloth-physics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832361,"owners_count":16888223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloth","cloth-simulation","desktop-app","gio","go","golang","math","physics","simulation","verlet"],"created_at":"2024-10-15T01:10:49.091Z","updated_at":"2024-10-28T13:33:32.204Z","avatar_url":"https://github.com/esimov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloth-physics\n[![Build](https://github.com/esimov/cloth-physics/actions/workflows/build.yml/badge.svg)](https://github.com/esimov/cloth-physics/actions/workflows/build.yml)\n[![License](https://img.shields.io/github/license/esimov/cloth-physics)](./LICENSE)\n[![Release](https://img.shields.io/badge/release-v1.0.3-blue.svg)](https://github.com/esimov/cloth-physics/releases/tag/v1.0.3)\n\n**cloth-physics** is a native desktop application for 2D cloth physics simulation implementing [Verlet integration](https://en.wikipedia.org/wiki/Verlet_integration). It's written in [Gio](https://gioui.org), a GUI framework for [Go](https://golang.org/). \n\nIt has the following characteristics:\n- [x] Possibility to tear up the cloth by applying a mouse pressure on the cloth structure. You can increase the mouse dragging force by pressing and holding the left mouse button. The mouse focus area will change its color depending on the applied force.\n- [x] Possibility to make up a hole in the cloth structure by pressing the right mouse button.\n- [x] You can change the mouse cloth interaction area by using the scroll button.\n- [x] With \u003ckbd\u003eCTRL-left\u003c/kbd\u003e click you can pin up the cloth stick under the mouse position.\n\n**Note:** In case you want to learn more about the implementation details, here is a detailed article I wrote: https://medium.com/@esimov/2d-cloth-simulation-in-go-using-gio-gui-b3dfe00b7223.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./cloth-sim.gif\"/\u003e\u003c/p\u003e\n\n## How to run\nBefore running the application check the Gio [documentation](https://gioui.org/doc/install) for the system requirements. Install the required dependencies then type the following commands.\n\n```bash\n$ git clone https://github.com/esimov/cloth-physics\n$ go run ./...\n```\n\nAnother way is to build the executable yourself then simply run it. \n\n```bash\n$ go build ./...\n$ cloth-physics\n```\n\nIf you don't have Go installed on your machine you can run the prebuild binary files from the project [packages](https://github.com/esimov/cloth-physics/packages) page. For convenience if you wish to try the application on a mobile device the **`.apk`** file is also provided in the same packages page.\n\n#### Debugging:\n```bash\n$ cloth-physics -h\n\n  -debug-cpuprofile string\n        write CPU profile to this file\n  -debug-frame\n        debug the Gio frame rates\n```\n\n## Supported key bindings:\n* \u003ckbd\u003eF1\u003c/kbd\u003e - Show/hide the quick help panel\n* \u003ckbd\u003eSPACE\u003c/kbd\u003e - Redraw the cloth\n* \u003ckbd\u003eRIGHT CLICK\u003c/kbd\u003e - Tear the cloth at the mouse position\n* \u003ckbd\u003eSCROLL Up/Down\u003c/kbd\u003e - Increase/decrease the mouse focus area\n* \u003ckbd\u003eCTRL+CLICK\u003c/kbd\u003e - Pin up the cloth on the mouse position\n* \u003ckbd\u003eLEFT CLICK+HOLD\u003c/kbd\u003e - Increase the mouse pressure\n\n## Author\n* Endre Simo ([@simo_endre](https://twitter.com/simo_endre))\n\n## License\nCopyright © 2023 Endre Simo\n\nThis software is distributed under the MIT license. See the [LICENSE](https://github.com/esimov/cloth-physics/blob/master/LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fcloth-physics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesimov%2Fcloth-physics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimov%2Fcloth-physics/lists"}