Is it possible to show normal on the mesh surface by using open3D?
Asked Answered
A

1

6

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?

Thank you for the help

Allmon answered 21/11, 2019 at 9:7 Comment(0)
A
17

once you have calculated the normals, you can render the normals by pressing ctrl + 9 in the visualizer, e.g.

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:Normal rendering If you want to see the vertex normals as lines, I'm not sure this is supported in open3d for meshes yet. 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. This will give you something like this:Vertex normals

Akbar answered 27/11, 2019 at 14:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.