class_docstr: A ThreeJS based viewer class for viewing 3D meshes.
docstr: Creates a dictionary of ThreeJS mesh objects from numpy data.
docstr_tok: ["Creates","a","dictionary","of","ThreeJS","mesh","objects","from","numpy","data","."]
code: def _mesh_from_data(self, data: Dict[str, Any]) -> Dict[str, Any]:
      """Creates a dictionary of ThreeJS mesh objects from numpy data."""
      if "vertices" not in data or "faces" not in data:
          raise ValueError("Mesh Data must contain vertices and faces")
      vertices = np.asarray(data["vertices"])
      faces = np.asarray(data["faces"])
      material = self.context.THREE.MeshLambertMaterial.new_object(
          {
              "color": 0xFFFACD,
              "vertexColors": self.context.THREE.NoColors,
              "side": self.context.THREE.DoubleSide,
          }
      )
      mesh = {"vertices": vertices, "faces": faces}
      if "vertex_colors" in data:
          mesh["vertex_colors"] = np.asarray(data["vertex_colors"])
          material = self.context.THREE.MeshLambertMaterial.new_object(
              {
                  "color": 0xFFFACD,
                  "vertexColors": self.context.THREE.VertexColors,
                  "side": self.context.THREE.DoubleSide,
              }
          )
      mesh["material"] = material
      return mesh
  
file_path: graphics/tensorflow_graphics/notebooks/mesh_viewer.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Any, Dict
  import numpy
  from tensorflow_graphics.notebooks import threejs_visualization
label_desc: Use image node_id 1 for calling the Viewer obj's underlying member method code with example usage: obj._mesh_from_data(data) and returns: mesh