How can i draw .txt data written in meshgrid format.

Hello,

I was able to load it in the same way as the link below.

Now you need to modify the Script (RequestInformation) and Script in the Programmable Source Filter.

  • Script (RequestInformation)
from paraview import util
util.SetOutputWholeExtent(self, [0, 140, 0, 141, 0, 0])
  • Script
import numpy as np

path = 'your_data_path/Ux.txt'
a = np.loadtxt(path, encoding='utf-8_sig').flatten()

output.SetDimensions(141, 142, 1)
output.SetOrigin(0.0, 0.0, 0.0)
output.SetSpacing(1, 1, 1)
output.PointData.append(a, 'height')

1 Like