有什么方法可以使用Python在JSON中在JSON中保存为网格的两个CAD模型之间的相似性得分?
我想获得两个JSON模型之间的相似性分数,即{x,y,z}坐标通常在CAD型号作为网格中保存时获得的坐标,以执行将它们发送到3D打印机之类的事情。
以下是两个JSON模型的子集:
模型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 }
]
模型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 }
]
正如我们所看到的,模型的大小也不同。
因此,假设模型2处于正确的方向并且与模型1相同的位置,那么有什么方法可以使用Python计算这两个坐标阵列之间的相似性得分?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论