def distanceToMesh(self, actor, signed=False, negate=False):
        '''
        Computes the (signed) distance from one mesh to another.
        
        .. hint:: |distance2mesh| |distance2mesh.py|_
        '''
        poly1 = self.polydata()
        poly2 = actor.polydata()
        df = vtk.vtkDistancePolyDataFilter()
        df.SetInputData(0, poly1)
        df.SetInputData(1, poly2)
        if signed:
            df.SignedDistanceOn()
        if negate:
            df.NegateDistanceOn()
        df.Update()
        
        scals = df.GetOutput().GetPointData().GetScalars()
        poly1.GetPointData().AddArray(scals)

        poly1.GetPointData().SetActiveScalars(scals.GetName())
        rng = scals.GetRange()
        self.mapper.SetScalarRange(rng[0], rng[1])
        self.mapper.ScalarVisibilityOn()
        return self
def distanceToMesh ( self , actor , signed = False , negate = False ) : poly1 = self . polydata ( ) poly2 = actor . polydata ( ) df = vtk . vtkDistancePolyDataFilter ( ) df . SetInputData ( 0 , poly1 ) df . SetInputData ( 1 , poly2 ) if signed : df . SignedDistanceOn ( ) if negate : df . NegateDistanceOn ( ) df . Update ( ) scals = df . GetOutput ( ) . GetPointData ( ) . GetScalars ( ) poly1 . GetPointData ( ) . AddArray ( scals ) poly1 . GetPointData ( ) . SetActiveScalars ( scals . GetName ( ) ) rng = scals . GetRange ( ) self . mapper . SetScalarRange ( rng [ 0 ] , rng [ 1 ] ) self . mapper . ScalarVisibilityOn ( ) return self
Computes the (signed) distance from one mesh to another.
        
        .. hint:: |distance2mesh| |distance2mesh.py|_