Can someone kindly help me understand why my meshes are not colliding properly?
I’m starting with a faceted mesh, and I want a planar version of is to sit on top of it (minimizing the distance between each pair of vertices (locking their movement in the z axis))
I have tired a variety of different methods, including using the ‘rigid_mesh_collision’ kangaroo example file as reference with no success.
So far the ‘sphereCollide’ component has yielded the best results, but they still eventually pass through each other. This would also leave a gap between the contact points of the meshes which I don’t necessarily want.
Thanks in advanced
240416_Kangaroo_Mesh_Collision_Issue.gh (45.7 KB)
1 Like
Not sure if you want the two meshes to be planar and connected where they are connected at first or if the two meshes can be separate?
To get the two meshes to stick together, you can cull the duplicates with the option ‘Leave One’. These points move upwards a certain amount, you chose 10000.
To move the planar meshes as close as possible to the closest point, sort the vector lengths and move the mesh vertically.
240416_Kangaroo_Mesh_CoPlanar.gh (23.7 KB)
If your goal is to have a planar mesh that lies on top of the original mesh in some kind of equilibrium, I think you might want to use vertical lines to constrain the vertices instead of the AnchorXYZ goal.
In this second test, I took just the larger of the two meshes and let it fall towards your original mesh.
Updated version of the second script is in post further down:
1 Like
Hi Martin, thanks for your response
Your second script does what I was trying to achieve.
That’s clever to use OnCurve as guide rails so that none of the vertices can move passed their respective original location
I noticed as well that the script works perfectly fine without the SphereCollide, I suppose for the reason mentioned above
When trying to solve for both meshes at the same time, I ran into a weird problem where they would get stuck together for some reason. A work around was to offset them by different amounts so that they do not start touching.
I also tried a different version of the script where the mesh is kept in place, given rails, and forced planar. But for some reason as soon as I run the solver, just jumps up by a few meters??
240416_Kangaroo_Mesh_CoPlanar_equilibrium_NL.gh (21.1 KB)
Haha nice, yes, that must be because of the OnCurve goal…
Note in my example the mesh for the solver is first moved upwards so it can fall down in the simulation.
240416_Kangaroo_Mesh_CoPlanar_equilibrium.gh (21.2 KB)
Yes that makes sense, but have a look at the second version that I tried. There is nothing that tells it to move up here, but it jumps up anyways
240416_Kangaroo_Mesh_CoPlanar_equilibrium_NL.gh (23.9 KB)
Also I want the faces to be solved independently of each other
This works if you move the initial meshes away from each other like you did in the disabledd version in your last file. As soon as two vertices are coincident, the solver combines them. Don’t ask me why this happens across branches.
1 Like
How odd.
Anyways thank you so much for you help Martin.
I really appreciate it!
1 Like
I like Kangaroo too, but its been quite tough to learn…
Balancing/tuning the strengths of various goals feels very tricky.
2 Likes