有什么方法可以使用Python在JSON中在JSON中保存为网格的两个CAD模型之间的相似性得分?

发布于 2025-01-23 15:02:37 字数 916 浏览 3 评论 0原文

我想获得两个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文