code: def _triangular_mesh_to_three_geometry(
      vertices, faces, vertex_colors=None
  ):
      """Converts a triangular mesh to a Three.js BufferGeometry object.
  
      Args:
        vertices: a [V,3] numpy ndarray containing the position of the vertices
          composing the mesh. V denotes the number of vertices. Vertex positions are
          expected to be floating values.
        faces: a [F,3] numpy array describing the vertices contained in each face of
          the mesh. F denotes the number of faces. The values of that array are
          expected to be positive integer values.
        vertex_colors: a [V, 3] numpy array describing the RGB color of each vertex
          in the mesh. V denotes the number of vertices. Each channel in vertex
          colors is expected to be floating values in range [0, 1].
  
      Returns:
        A BufferGeometry object describing the geometry of the mesh and which can
        be consumed by Three.js.
      """
      context = _js_builder.Js(mode=_js_builder.PERSISTENT)
      vertices = context.Float32Array.new_object(
          vertices.ravel().tolist()
      )
      faces = context.Uint32Array.new_object(faces.ravel().tolist())
      geometry = context.THREE.BufferGeometry.new_object()
      geometry.addAttribute(
          "position",
          context.THREE.BufferAttribute.new_object(vertices, 3),
      )
      geometry.setIndex(
          context.THREE.BufferAttribute.new_object(faces, 1)
      )
      geometry.computeVertexNormals()
      if vertex_colors is not None:
          vertex_colors = context.Float32Array.new_object(
              vertex_colors.ravel().tolist()
          )
          geometry.addAttribute(
              "color",
              context.THREE.BufferAttribute.new_object(
                  vertex_colors, 3
              ),
          )
  
      return geometry
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: _triangular_mesh_to_three_geometry(vertices, faces, vertex_colors) and returns: geometry