code: def split(self):
      
      # avoid a circular import by referencing class of self
      Path2D = type(self)
  
      # save the results of the split to an array
      split = []
  
      # get objects from cache to avoid a bajillion
      # cache checks inside the tight loop
      paths = self.paths
      discrete = self.discrete
      polygons_closed = self.polygons_closed
      enclosure_directed = self.enclosure_directed
  
      for root_index, root in enumerate(self.root):
          # get a list of the root curve's children
          connected = list(enclosure_directed[root].keys())
          # add the root node to the list
          connected.append(root)
  
          # store new paths and entities
          new_paths = []
          new_entities = []
  
          for index in connected:
              path = paths[index]
              # add a path which is just sequential indexes
              new_paths.append(np.arange(len(path)) +
                               len(new_entities))
              # save the entity indexes
              new_entities.extend(path)
  
          # store the root index from the original drawing
          metadata = copy.deepcopy(self.metadata)
          metadata['split_2D'] = root_index
          # we made the root path the last index of connected
          new_root = np.array([len(new_paths) - 1])
  
          # prevents the copying from nuking our cache
          with self._cache:
              # create the Path2D
              split.append(Path2D(
                  entities=copy.deepcopy(self.entities[new_entities]),
                  vertices=copy.deepcopy(self.vertices),
                  metadata=metadata))
              # add back expensive things to the cache
              split[-1]._cache.update(
                  {'paths': new_paths,
                   'polygons_closed': polygons_closed[connected],
                   'discrete': discrete[connected],
                   'root': new_root})
              # set the cache ID
              split[-1]._cache.id_set()
  
      return np.array(split)
docs: Split a Path2D into multiple Path2D objects where each
      one has exactly one root curve.
  
      Parameters
      --------------
      self : trimesh.path.Path2D
        Input geometry
  
      Returns
      -------------
      split : list of trimesh.path.Path2D
        Original geometry as separate paths