code: def center_of_mass(self, scalars_weight=False):
          
          comfilter = vtk.vtkCenterOfMass()
          comfilter.SetInputData(self)
          comfilter.SetUseScalarsAsWeights(scalars_weight)
          comfilter.Update()
          return np.array(comfilter.GetCenter())
docs: Returns the coordinates for the center of mass of the mesh.
  
          Parameters
          ----------
          scalars_weight : bool, optional
              Flag for using the mesh scalars as weights. Defaults to False.
  
          Return
          ------
          center : np.ndarray, float
              Coordinates for the center of mass.