code: def remove_unreferenced_vertices(self):
          
  
          unique = self.referenced_vertices
  
          mask = np.ones(len(self.vertices), dtype=np.int64) * -1
          mask[unique] = np.arange(len(unique), dtype=np.int64)
  
          self.replace_vertex_references(mask=mask)
          self.vertices = self.vertices[unique]
docs: Removes all vertices which aren't used by an entity.
  
          Alters
          ---------
          self.vertices: reordered and shortened
          self.entities: entity.points references updated