Coder Social home page Coder Social logo

esimov / cloth-physics Goto Github PK

View Code? Open in Web Editor NEW
34.0 2.0 3.0 185.87 MB

Desktop application for cloth physics simulation using Gio GUI.

License: MIT License

Go 96.40% Makefile 0.40% Shell 3.20%
cloth gio go golang math simulation verlet desktop-app cloth-simulation physics

cloth-physics's Introduction

cloth-physics

Build License Release

cloth-physics is a native desktop application for 2D cloth physics simulation implementing Verlet integration. It's written in Gio, a GUI framework for Go.

It has the following characteristics:

  • 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.
  • Possibility to make up a hole in the cloth structure by pressing the right mouse button.
  • You can change the mouse cloth interaction area by using the scroll button.
  • With CTRL-left click you can pin up the cloth stick under the mouse position.

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.

How to run

Before running the application check the Gio documentation for the system requirements. Install the required dependencies then type the following commands.

$ git clone https://github.com/esimov/cloth-physics
$ go run ./...

Another way is to build the executable yourself then simply run it.

$ go build ./...
$ cloth-physics

If you don't have Go installed on your machine you can run the prebuild binary files from the project 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.

Debugging:

$ cloth-physics -h

  -debug-cpuprofile string
        write CPU profile to this file
  -debug-frame
        debug the Gio frame rates

Supported key bindings:

  • F1 - Show/hide the quick help panel
  • SPACE - Redraw the cloth
  • RIGHT CLICK - Tear the cloth at the mouse position
  • SCROLL Up/Down - Increase/decrease the mouse focus area
  • CTRL+CLICK - Pin up the cloth on the mouse position
  • LEFT CLICK+HOLD - Increase the mouse pressure

Author

License

Copyright © 2023 Endre Simo

This software is distributed under the MIT license. See the LICENSE file for the full license text.

cloth-physics's People

Contributors

aquilax avatar esimov avatar whereswaldon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.