Code Monkey home page Code Monkey logo

Comments (4)

pdcxs avatar pdcxs commented on May 14, 2024

It is not an easy task to create a rope in all physics engines. To the best of my knowledge, the only way to simulate rope is using joint segments/springs. The following links may be helpful:
Stackoverflow: How to create rope
pymunk joint document

from manim-physics.

kevinlu1248 avatar kevinlu1248 commented on May 14, 2024

As an update on this, I actually do have something functioning, although it does have quite a bit of overhead and it has some strange rippling effects. Further, it can move through objects when moving too fast. I will send a video later showing this.

from manim-physics.

kevinlu1248 avatar kevinlu1248 commented on May 14, 2024

Brief example of a point trying to run away while leashed to two nails.

IntroPuzzle.mp4

from manim-physics.

kevinlu1248 avatar kevinlu1248 commented on May 14, 2024

It's basically a chain:

video-1627443070.mp4

But then every frame I get a spline interpolator to smoothen the curve:

video-1627452168.mp4

At the moment, I'm facing a few issues with this implementation:

  • Getting the beginning and end of the curve to have equal slopes (can't find a good algorithm to smoothen/interpolate a 2D closed curve)
  • Slow render times when I place the beginning and of the chain too close together although t
  • Too jittery; not too sure what causes this but decreasing the damping parameter helps significantly.
  • Like any object, moving too quickly causes this to move through obstacles
  • I also don't know how to make the rope stretchy. I tried making the tension adjustable but it causes some really strange behaviour...

On the other hand this method does produce a decent rope without too many chains at a reasonable level of performance. I can do a PR if your interested in having this in your library.

from manim-physics.

Related Issues (12)

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.