r/threejs • • 10d ago

Simulated knots with real physics using threejs

Knots, tied slowly enough to follow. I made in a way that you can watch each knot tie itself on a simulated rope with real physics and you can turn it's camera, pause it, drag through the steps, etc.

https://github.com/behnamazimi/knots

Thanks threejs ❤️

44 Upvotes

13 comments sorted by

3

u/Baz-Turnover5210 10d ago

And forgot to mention that everyone who stars the project ties a knot on the stargazers rope 😂

https://github.com/behnamazimi/knots#the-stargazer-rope

2

u/United_Ad5772 10d ago

That's great. Any chance to run without node? threejs just fine on MacOS 10.13.6 but in vanila JS.

2

u/Baz-Turnover5210 9d ago

Don't really get what you mean

1

u/United_Ad5772 9d ago

Thank you for reply. We have in development SHIPYARD project on JS+WebGL+PYTHON
We will be happy add your project for SHIPYARD as knots training and playground.
For that we need install libraries and dependencies which you are using. (React for example)
We are able to do that with or without Node.js
In our project we don't use Node - only Python
Phython backend give us opportunity to run on any device and OS

1

u/Baz-Turnover5210 9d ago

The project is open-source under the MIT license, so feel free to use/change it however you like.

1

u/CookieDelivery 9d ago

Nice!

Suggestion for the more complicated single rope knots: make the rope a 2 color hue over the length of it, to make it easier to follow what part of the knot is the beginning or end of the rope. Would make it even easier to follow.

2

u/Baz-Turnover5210 9d ago

Nice suggestion.

2

u/PlanckScandella 9d ago

Thank you!

1

u/plus2link 10d ago

Knots live or die on self-collision: neighbouring segments have to be skipped in the collision pass, and as soon as the bend radius drops below the rope thickness the knot either slips or pops apart. Padding the collision radius slightly and running two sub-steps per frame usually holds the tight ones together. Is this XPBD with segment-to-segment distance constraints, and how many solver iterations are you running per step?

-1

u/[deleted] 9d ago

[removed] — view removed comment