code: def update_faces(self, mask):
          
          # if the mesh is already empty we can't remove anything
          if self.is_empty:
              return
  
          mask = np.asanyarray(mask)
          if mask.dtype.name == 'bool' and mask.all():
              # mask removes no faces so exit early
              return
  
          # try to save face normals before dumping cache
          cached_normals = self._cache['face_normals']
  
          faces = self._data['faces']
          # if Trimesh has been subclassed and faces have been moved from data
          # to cache, get faces from cache.
          if not util.is_shape(faces, (-1, 3)):
              faces = self._cache['faces']
  
          # actually apply the mask
          self.faces = faces[mask]
          # apply the mask to the visual object
          self.visual.update_faces(mask)
  
          # if our normals were the correct shape apply them
          if util.is_shape(cached_normals, (-1, 3)):
              self.face_normals = cached_normals[mask]
docs: In many cases, we will want to remove specific faces.
          However, there is additional bookkeeping to do this cleanly.
          This function updates the set of faces with a validity mask,
          as well as keeping track of normals and colors.
  
          Parameters
          ---------
          valid : (m) int or (len(self.faces)) bool
            Mask to remove faces