如何使用EG OPEND3D和PYTHON从STL文件中可视化3D网格?

发布于 2025-01-20 23:21:17 字数 452 浏览 8 评论 0原文

我有一个步骤文件,然后将其转换为STL文件。我需要STL格式能够从3D网格中提取某些功能。此外,我想以互动方式可视化3D模型,即用户应该能够旋转和扩展模型。我发现的代码使用 open3d 到目前为止

import open3d as o3d

def visualize(mesh):
    vis = o3d.visualization.Visualizer()
    vis.create_window()
    vis.add_geometry(mesh)
    vis.run()
    vis.destroy_window()

mesh = o3d.io.read_triangle_model(path_stl_file)
visualize(mesh)

任何想法如何正确地做到这一点?谢谢。

I have a STEP file which I converted into an STL file. I need the STL format to be able to extract certain features out of the 3D mesh. Further, I want to visualize the 3D model in an interactive manner, i.e. the user should be able to rotate and scale the model. The code I found, which uses Open3D, doesn't work so far:

import open3d as o3d

def visualize(mesh):
    vis = o3d.visualization.Visualizer()
    vis.create_window()
    vis.add_geometry(mesh)
    vis.run()
    vis.destroy_window()

mesh = o3d.io.read_triangle_model(path_stl_file)
visualize(mesh)

Any idea how to do it the right way? Thx.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雪化雨蝶 2025-01-27 23:21:17

argh,我使用了错误的进口商。要使用的功能是:

read_triangle_mesh(path_stl_file)

Argh, I used the wrong importer. The function to be used is:

read_triangle_mesh(path_stl_file)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文