code: def triangular_mesh_renderer(
      meshes,
      lights=None,
      camera=None,
      width=800,
      height=600,
      clear_color="rgb(0, 0, 0)",
  ):
      """Function for simple mesh visualization using Three.js.
  
      Args:
        meshes: a list or tuple of dictionaries, each containing two required keys:
          'vertices', a [V,3] numpy ndarray of vertices, and 'faces' a [F,3] numpy
          ndarray of vertex indices that belong to each face of the mesh. V and F
          respectively correspond to the number of vertices and faces in any given
          mesh. In addition, following optional keys may be provided for each mesh:
            'vertex_colors', a [V, 3] numpy ndarray of vertex colors, and
            'material', a Three.js Material object. If a material is not provided,
            then a default Lambertian material is used.
        lights: a list of Three.js lights to add to the scene. If no light is
          provided, a point light is added to the scene at the position (0., 0.,
          5.).
        camera: a Three.js camera to add to the scene. If no camera is provided, a
          perspetive camera with orbit controls is added to the scene.
        width: the width of the rendering window.
        height: the height of the rendering window.
        clear_color: the color of the background of the rendering window.
  
      Returns:
        A list of Three.js BufferGeometry objects that can be used to manipulate the
        vertices of the meshes being rendered.
      """
      if not isinstance(meshes, (tuple, list)):
          meshes = [meshes]
  
      context = build_context()
  
      # Instantiate the renderer.
      renderer = context.THREE.WebGLRenderer.new_object(
          {"antialias": True}
      )
      renderer.setSize(width, height)
      renderer.setClearColor(
          context.THREE.Color.new_object(clear_color)
      )
      renderer.clear()
      context.document.body.appendChild(renderer.domElement)
  
      # If no camera is supplied, create a default one.
      if camera is None:
          camera = context.THREE.PerspectiveCamera.new_object(
              75.0, float(width) / float(height), 0.1, 1000.0
          )
          camera.position.z = 5.0
          controls = context.THREE.OrbitControls.new_object(camera)
          controls.enableZoom = False
  
      # Create the scene.
      scene = context.THREE.Scene.new_object()
  
      # Add lights to the scene.
      if lights is None:
          ambient_light = context.THREE.AmbientLight.new_object(
              0x404040
          )
          point_light = context.THREE.PointLight.new_object(0xFFFFFF)
          point_light.position.set(0.0, 0.0, 5.0)
          lights = (ambient_light, point_light)
      for light in lights:
          scene.add(light)
  
      # Build meshes and add then to the scene.
      default_material = context.THREE.MeshLambertMaterial.new_object(
          {
              "color": 0x808080,
          }
      )
      geometries = []
      for mesh in meshes:
          if (
              "vertex_colors" in mesh.keys()
              and mesh["vertex_colors"] is not None
          ):
              vertex_colors = mesh["vertex_colors"]
              default_material[
                  "vertexColors"
              ] = context.THREE.VertexColors
          else:
              vertex_colors = None
              default_material["vertexColors"] = context.THREE.NoColors
          geometry = _triangular_mesh_to_three_geometry(
              mesh["vertices"], mesh["faces"], vertex_colors
          )
          geometries.append(geometry)
          if "material" in mesh.keys() and mesh["material"] is not None:
              scene.add(
                  context.THREE.Mesh.new_object(
                      geometry, mesh["material"]
                  )
              )
          else:
              scene.add(
                  context.THREE.Mesh.new_object(
                      geometry, default_material
                  )
              )
  
      # Create animate function and call it to start rendering.
      rendering_loop_txt = """
  			var animate = function () {
  				requestAnimationFrame(animate);
  				%s.render(%s, %s);
  			};
  			animate();
    """ % (
          renderer._js_value(),
          scene._js_value(),
          camera._js_value(),
      )  # pylint: disable=protected-access
      eval_js(rendering_loop_txt)
      return geometries
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: triangular_mesh_renderer(meshes, lights, camera, width, height, clear_color) and returns: geometries