Is it possible to compare 2 meshes for the complementarity of their respective surfaces? Is there a way in Blender to compare two pieces of mesh or two meshes to its similarity? Maybe with some script or an addon.

What I mean: there is a stone or brick broken into half for example:


This is a kind of forensic or architectural task.
The goal is to prove that those 2 pieces have similar surfaces and may be connected to each other with some threshold or they were a one piece before.
I know of "select similar" in Blender, similar face area in this case, but it doesn't work quite well for such a task.

I am not a coder so I can't figure out a possibility of solving this.
So what is the way to do it?
This is actually a not so trivial problem. You might be better off asking this question on the maths stack exchange as it will require more than just Blender knowledge.

This will require coding skills as well, I fear.