简体   繁体   English

是否可以通过使用 open3D 在网格表面上显示法线?

[英]Is it possible to show normal on the mesh surface by using open3D?

I'm using Open3D to create mesh, and on the official web we can compute triangle normal of triangle mesh, but how to visualize the normal of the surface?我正在使用 Open3D 创建网格,在官方 web 上我们可以计算三角形网格的三角形法线,但是如何可视化曲面的法线?

Thank you for the help感谢您的帮助

once you have calculated the normals, you can render the normals by pressing ctrl + 9 in the visualizer, eg计算出法线后,您可以通过在可视化工具中按ctrl + 9来渲染法线,例如

import open3d as o3d

mesh = o3d.io.read_triangle_mesh('path_to_mesh')
mesh.compute_vertex_normals()
o3d.visualization.draw_geometries([mesh])

This will give you something like this:这会给你这样的东西: 正常渲染 If you want to see the vertex normals as lines, I'm not sure this is supported in open3d for meshes yet.如果您想将顶点法线视为线,我不确定 open3d 是否支持网格。 But you can convert the mesh to a point cloud:但是您可以将网格转换为点云:

pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(np.asarray(mesh.vertices))
pcd.estimate_normals()

and then visualize the normals by pressing n in the visualizer.然后在可视化器中按n可视化法线。 This will give you something like this:这会给你这样的东西: 顶点法线

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM