code: def get_random_mesh(
      num_vertices, add_faces=False, add_colors=False, batch_size=1
  ):
      """Returns a random point cloud, optionally with random disconnected faces.
  
      Args:
        num_vertices: Number of vertices in the point cloud or mesh.
        add_faces: Random faces will be generated and added to the mesh when True.
        add_colors: Random colors will be assigned to each vertex when True. Each
          color will be in a range of [0, 255].
        batch_size: Size of batch dimension in output array.
  
      Returns:
        Mesh dataclass with vertices and optionally with faces and/or colors.
      """
      vertices = np.random.random([num_vertices, 3]) * 1000
      # Add batch dimension.
      vertices = np.tile(vertices, [batch_size, 1, 1])
      faces = None
      colors = None
      if add_faces:
          arranged_vertices = np.random.permutation(num_vertices)
          faces = []
          for i in range(num_vertices - 2):
              faces.append(
                  [
                      arranged_vertices[i],
                      arranged_vertices[i + 1],
                      arranged_vertices[i + 2],
                  ]
              )
          faces = np.array(faces)
          faces = np.tile(faces, [batch_size, 1, 1]).astype(np.int32)
      if add_colors:
          colors = np.random.randint(
              low=0, high=255, size=[num_vertices, 3]
          )
          colors = np.tile(colors, [batch_size, 1, 1]).astype(np.uint8)
      return Mesh(vertices.astype(np.float32), faces, colors)
  
file_path: tensorboard/tensorboard/plugins/mesh/test_utils.py
imports: import dataclasses
  import json
  import numpy
  from tensorboard.util import tb_logging
label_desc: Use image node_id 1 for calling a global function with example usage: get_random_mesh(num_vertices, add_faces, add_colors, batch_size) and returns: Mesh