diff --git a/vtkpytools/barfiletools/data.py b/vtkpytools/barfiletools/data.py index 3b81e2a..3bb8aad 100644 --- a/vtkpytools/barfiletools/data.py +++ b/vtkpytools/barfiletools/data.py @@ -207,7 +207,7 @@ def sampleDataBlockProfile(dataBlock, line_walldists, pointid=None, cutterobj : vtk.vtkPlane, optional VTK object that defines the profile location via intersection with the 'wall' - normal : numpy.ndarray + normal : numpy.ndarray, optional If given, use this vector as the wall normal. Returns @@ -233,6 +233,9 @@ def sampleDataBlockProfile(dataBlock, line_walldists, pointid=None, sample_line = sample_line.sample(dataBlock['grid']) sample_line['WallDistance'] = line_walldists + sample_line = Profile(sample_line) + sample_line.setWallDataFromPointID(wall, pointid) + if cutterobj: cutterout = vCutter(wall, cutterobj) if cutterout.points.shape[0] != 1: diff --git a/vtkpytools/common.py b/vtkpytools/common.py index 01b4168..5696192 100644 --- a/vtkpytools/common.py +++ b/vtkpytools/common.py @@ -96,6 +96,13 @@ def setWallDataFromPolyDataPoint(self, PolyPoint): self.walldata = dict(PolyPoint.point_arrays) self.walldata['Point'] = PolyPoint.points + def setWallDataFromPointID(self, wall, pointid): + """Set walldata attribute from point id of wall point """ + + for array_name in wall.array_names: + self.walldata[array_name] = wall[array_name][pointid] + self.walldata['Point'] = wall.points[pointid] + def readBinaryArray(path, ncols) -> np.ndarray: """Get array from Fortran binary file.