Can you please let me know how it finds the reference mesh? What algorithm goes behind it? And also how to find which mesh is the reference mesh in the Shapeworks software?
This method performs pairwise ICP registrations between shapes and computes the average surface to surface distance. Then it picks the mesh that had the minimal distance to all other shapes.
It returns the index of this mesh, which should be the index into mesh_list for the reference.
Is the same reference mesh (obtained from the median mesh) used to generate all mode meshes?
Also, how to get the median mesh based on the particle system?
It is possible to get the median of all particles (shown as median_particle) but how to get the median geometry using the below python code?
Yes, the same reference/template mesh is used to generate all reconstructions. In principle it can be any shape from the model, but we chose the median shape.
The Python API seems to be missing a method to query the median shape. I’ve created an issue to add it here:
Briefly, it is identified by finding the shape that is closest to all other shapes (in the global space). This is done by adding up the particle-particle distance for each shape and finding the shape that has the minimum sum of particle-particle distances (L1 Norm).
I am not sure what the median position of each particle would define, but any set of particles can be used with the MeshWarper.