-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modification to physics based layouter #42
Comments
Do you have a set of parameters that you would recommend? I've played around with it a bit, but can't find a setup that works very well. (Nodes still fly off when unconnected) Might be caused by a bug somewhere, since intuitively the friction should stop them sometime, but increasing friction has barely any impact. |
Unfortunately I've not been able to compile the code to test (let's not solve that here). Looking over what you have written I can't see anything obviously wrong. I would set up a very simple simulation with 2 unconnected nodes (one fixed position) and see at what distance friction overcomes reupulsion. It may be necessary to have repulsion fall off more rapidly, which will require smaller spring constant once connected. |
I've finally managed to find some time to take a look at this and to get it working. I have a couple of proposed changes (locally) but I'm not quite sure how to create a pull request for it. Is this a setting on your end or am I doing something wrong my end I wonder. In brief:
|
I fixed item 2 in commit aa35e0b, thanks for that. The other two suggestions seem to produce unstable results for me, for example when piling nodes on top of eachother. However, in my limited testing it seems like it already works pretty good by just fixing the friction? |
Fix worked to an extent for me. Now nodes don't ping off into the distance. However, nodes do now 'jitter' when the friction force is larger than the repulsion force and the node is nearly at rest. I.e. the friction component is causing a node to accelerate in the opposite direction. I would still reccomend removing the normalisation so that very slow moving nodes don't suddenly change direction due to friction forces alone. |
I notice that your repulsion force is proportional to 1/Distance. this is causing unconnected nodes to get ejected from a local group quite drastically. I would propose increasing the repulsion coefficent slightly and making the force proportional to 1/Distance^2 (similar to how gravity attracts). you cold then increase the friction component so that nodes slow down faster.
The text was updated successfully, but these errors were encountered: