Although it's most likely possible to simulate cable tangling with Geometry Nodes it is currently too complicated to set up due to lack of physics simulation operators. I would love seeing it executed in Geometry nodes in this thread at some point in the near future.
In this solution we are going to use the currently available Soft Body Physics simulation.
It is preferred due to the availability of Collision settings for the points of the simulated mesh. (Soft Body is basically collision balls connected with springs).
Although it looks quite complicated the concept is fairly easy to understand and developed further.
Back in the days - I designed the tangling in such a way that the colored wires form the year 2020:
Simulating the whole tangling process is not possible due to time and program limitations so we will take an artistic shortcut and draw our approximately desired look of the cables from the Top View using Grease Pencil.
- First let's block out the Scene by placing a floor plane and some cylinders:
They will also participate in the simulation so add Collision Modifier for each one of them. You could leave the default collision settings and adjust them later - mostly the Thickness Outer parameter.
- Now go to Top View, choose an appropriate Viewport display and draw a continuous squiggly line. The main idea is just to draw while avoiding intersections with the cylinders. You can cross the line itself as many times as you want. You can draw multiple lines based on how many individual cables you want. In this case I drew 2 separate lines. The coloring is optional and I did it for illustration purposes:
[Easy Mode] To make things easier one can skip the Cylinders part and work with the Floor as the only collision object.
You can sculpt the Grease Pencil Strokes using Grab and Smooth brushes correcting intersections with the collision objects and making the curved lines smoother. [Note] This look will not remain exactly the same due to the simulation so don't spend too much time sculpting. Once you are happy with the look you can proceed to converting the Grease Pencil object to Curve object.
The Curve object needs to be resampled using Geometry Nodes. Imagine this Curve as a bead string and each bead has a constant radius slightly larger than the radius of the cable. I created a small circle to help me decide the resampling Length value which is double the circle radius - in this case 6.66 cm. The node setup is Applied to the Curve object:
- Apply the Geometry Nodes modifier to the Curve. Usually this works by choosing in the 3D View - Object > Apply > Visual Geometry To Mesh.
This will convert the Curve to Mesh:
[Optional] Add Hook Modifiers to both end vertices of each string inside the Mesh. In my case there are 4 Hook Modifiers in total. You could add more vertices to the Hooks if needed. Make sure to add the vertices assigned to the hooks - all into a single Vertex Group and name it "Goal". This way we can animate the ends of the cables during the simulation and position them where we want.
We can now add Soft Body Modifier to the Mesh
The Soft Body Settings are shown bellow, but these can be tweaked according to your scene dimensions and preferences:
The most important setting is turning on the Self Collision and setting the Calculation Type to Manual with Ball Size set to slightly less than the radius of the small circle we used for choosing the resampling length.
- Now you can push the Floor slightly down. You can play with the distance. [Optionally] Add a Force Field Empty of type Force, Shape - Plane and animate the Strength from 0.1 to 0 and Noise Amount from 3 to 0 for the first 10 frames of the simulation. Also animate the Hook Empties to place the ends of the cables at the desired final positions:
- Run the simulation. Usually in 50 frames the result becomes stable. The simulation is a bit slow due to the enabled self collisions of the balls ("beads"). The balls will try to push themselves away from each other while tangling the strings along the process. The end frame should looks something like this:
- To generate the cables we are going to add Geometry Node Modifier to convert the Mesh back to Curve, smooth it out a little bit and add some thickness to the Curve. Here is the node set up, which also includes adding different materials to the cables:
Examining the simulation from all sides shows variety of tangles:
One can apply the simulated result and edit the mesh refining it even further, before applying the final Geometry Node Modifier.
Lastly you can download and study the .blend file from the tutorial: