Open
Description
Checklist
- I have searched for similar issues.
- For Python issues, I have tested with the latest development wheel.
- I have checked the release documentation and the latest documentation (for
main
branch).
Proposed new feature or change
The colors of a triangle mesh is ignored by o3d.visualization.draw_plotly
. We could consider implementing a similar behavior to get_point_object
in get_mesh_object
?
def get_mesh_object(geometry,):
triangles = np.asarray(geometry.triangles)
vertices = np.asarray(geometry.vertices)
if geometry.has_vertex_colors():
vertexcolor = np.asarray(geometry.vertex_colors)
elif geometry.has_vertex_normals():
vertexcolor = (0.5, 0.5, 0.5) + np.asarray(geometry.vertex_normals) * 0.5
else:
geometry.paint_uniform_color((0.6, 0.6, 0.6))
vertexcolor = np.asarray(geometry.vertex_colors)
mesh_3d = go.Mesh3d(x=vertices[:, 0],
y=vertices[:, 1],
z=vertices[:, 2],
i=triangles[:, 0],
j=triangles[:, 1],
k=triangles[:, 2],
vertexcolor=vertexcolor,
flatshading=True,
lighting=dict(ambient=0.18,
diffuse=1,
fresnel=0.1,
specular=1,
roughness=0.05,
facenormalsepsilon=1e-15,
vertexnormalsepsilon=1e-15),
lightposition=dict(x=100, y=200, z=0))
return mesh_3d
References
No response
Additional information
No response