line_width
是Open3D中open3d.visualization.RenderOption
的一个属性,它控制了展示线的宽度。默认值为1.0,即1个像素宽度。
class open3d.visualization.RenderOption:
line_width: float = 1.0
...
line_width
:要设置的线宽度,单位像素。import open3d as o3d
import numpy as np
pcd = o3d.geometry.PointCloud()
points = np.array([[0,0,0], [0,0,1], [0,1,0], [1,0,0]])
pcd.points = o3d.utility.Vector3dVector(points)
# 设置点的颜色为蓝色
pcd.paint_uniform_color([0.0, 0.0, 1.0])
# 设置线宽度为5
opt = o3d.visualization.RenderOption()
opt.line_width = 5
o3d.visualization.draw_geometries([pcd], width=800, height=600, render_options=opt)
图中展示了一个四个点组成的点云的3D效果图。线宽为5px。