I would like to ask if there is an existing RhinoCommon method that could help me identify mesh faces that touch each other. MeshMeshFast or MeshMeshAccurate outputs geometry only (lines or polylines). This I use just for identifying if meshes are colliding. But I am trying to find out touching mesh faces id.
First I was thinking that I could somehow search coplanar planes. But since meshes could have many faces, the search could be slow.
Is the only way:
iterate over each mesh face
get its center
search mesh closest-point
skip result if distance between two points is bigger than a tolance?
you might try to use mesh.Faces.GetClashingFacePairs(). It works for a single mesh though. Maybe if you create a temp mesh and append your 2 meshes, you could assign the indices returned in pairs by comparison to the face count of the first mesh sphere.
This this method only works, when mesh faces are exactly the same, and touching at the same vertices.
If faces are touching but are shifted it will return null: