Detangle Solver

Here’s a detangle solver setup I used for a project recently. I used it on curves that has uniform pscale attribute, but with little modifications it could be used for curves with varying pscale.

Download Sample Scene

In a nutshell the setup works like this:

  • Iterate over the points

  • Find the nearest curve to the iterated point

  • Check if the curve is closer than it should be (inside the pscale)

  • Calculate vector pointing away from the curve

  • Move the point slightly away from the closest curve (along the previously calculated vector)

  • Smooth the affected areas slightly to avoid harsh edges

I’ve added another step to avoid tight corners as well which involves calculating the curvature and moving points that are in a tight corner. I let this setup run for 500 to 800 frames depending on the setup. In some cases 250 frames was good enough. Please check the sample scene to study the setup further.

Previous
Previous

Scale Groom by Clusters

Next
Next

Camera culling instanced scatter