(self, src_pts)
return src_pts + offset
This method performs the deformation of the mesh points. After the
        execution it sets `self.modified_mesh_points`.
This method performs the deformation of the mesh points. After the
        execution it sets `self.modified_mesh_points`.
This method performs the deformation of the mesh points . After the execution it sets self . modified_mesh_points .
def __call__(self, src_pts):
        """
        This method performs the deformation of the mesh points. After the
        execution it sets `self.modified_mesh_points`.
        """
        def distance(u, v):
            """ Norm of u - v """
            return np.linalg.norm(u - v, ord=self.power)

        # Compute displacement of the control points
        displ = self.deformed_control_points - self.original_control_points

        # Compute the distance between the mesh points and the control points
        dist = cdist(src_pts, self.original_control_points, distance)

        # Weights are set as the reciprocal of the distance if the distance is
        # not zero, otherwise 1.0 where distance is zero.
        weights = np.zeros(dist.shape)
        for i, d in enumerate(dist):
            weights[i] = 1. / d if d.all() else np.where(d == 0.0, 1.0, 0.0)

        offset = np.array([
            np.sum(displ * wi[:, np.newaxis] / np.sum(wi), axis=0)
            for wi in weights
        ])

        return src_pts + offset
def __call__ ( self , src_pts ) : def distance ( u , v ) : """ Norm of u - v """ return np . linalg . norm ( u - v , ord = self . power ) # Compute displacement of the control points displ = self . deformed_control_points - self . original_control_points # Compute the distance between the mesh points and the control points dist = cdist ( src_pts , self . original_control_points , distance ) # Weights are set as the reciprocal of the distance if the distance is # not zero, otherwise 1.0 where distance is zero. weights = np . zeros ( dist . shape ) for i , d in enumerate ( dist ) : weights [ i ] = 1. / d if d . all ( ) else np . where ( d == 0.0 , 1.0 , 0.0 ) offset = np . array ( [ np . sum ( displ * wi [ : , np . newaxis ] / np . sum ( wi ) , axis = 0 ) for wi in weights ] ) return src_pts + offset