Is there any way to measure similarity score between two CAD models saved as meshes (arrays of [x,y,z] co-ordinate sets) in JSON using Python?

Viewed 49

I want to obtain a similarity score between two JSON models i.e. {x,y,z} coordinates usually obtained when CAD models are saved as meshes to do things like sending them to a 3D printer.

Following are the subsets of the two JSON Models:

Model 1:

[
  { "x": -5.017247, "y": 5.285160000000001, "z": 8.08087 },
  { "x": 5.4679, "y": 5.285160000000001, "z": 8.08087 },
  { "x": -5.017247, "y": 5.285160000000001, "z": 15 },
  { "x": -5.017247, "y": 5.285160000000001, "z": 15 },
  { "x": 5.4679, "y": 5.285160000000001, "z": 8.08087 },
  { "x": 5.4679, "y": 5.285160000000001, "z": 15 },
  { "x": -5.017247, "y": 5.285160000000001, "z": -15 },
  { "x": 5.4679, "y": 5.285160000000001, "z": -15 }
]

Model 2:

[
  { "x": -12.5, "y": 8.74747, "z": -7.857685 },
  { "x": -12.5, "y": -5.746591, "z": -7.857685 },
  { "x": 12.5, "y": 8.74747, "z": -7.857685 },
  { "x": 12.5, "y": 8.74747, "z": -7.857685 }
]

As we can see the Models also differ in size.

So, is there any way we can compute the similarity score between these two arrays of coordinates using PYTHON, assuming that model 2 is in the correct orientation and in the same position as model 1?

0 Answers
Related