Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

How could I set line width for continuous boxes?

Open 3bobo opened this issue 3 years ago • 0 comments

Hi, I've seen problem #1480 , but the setting seems only works for boxes in a single frame not the continuous frames. How could I set it in continuous frames boxes? Here is my code:

  vis = o3d.visualization.Visualizer()
  vis.create_window()
  to_reset = True
  for k in range(10):
          lines = [[0, 1], [1, 2], [2, 3], [0, 3],[4, 5], [5, 6], [6, 7], [4, 7],[0, 4], [1, 5], [2, 6], [3, 7]]
          box = o3d.geometry.LineSet()
          box.points = o3d.utility.Vector3dVector(box_data)
          box.lines = o3d.utility.Vector2iVector(lines)
          box_colors = [blue for _ in range(len(lines))]
          box.colors = o3d.utility.Vector3dVector(box_colors)
          
          points = np.array(box) + [0, 0, 2]
          line_mesh = LineMesh(points, lines, colors, radius=0.02)
          line_mesh_geoms = line_mesh.cylinder_segments

          vis.add_geometry(*line_mesh_geoms)
          if to_reset:
              vis.reset_view_point(True)
              to_reset = False
          vis.poll_events()
          vis.update_renderer()
          vis.clear_geometries()

3bobo avatar Jul 29 '22 12:07 3bobo