Skip to content

Commit 5f37322

Browse files
committed
fix: vtk export had maximum > grid maximum
1 parent 12bdcd2 commit 5f37322

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

LoopStructural/datatypes/_structured_grid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def maximum(self):
6363
np.ndarray
6464
Maximum coordinates (origin + nsteps * step_vector)
6565
"""
66-
return self.origin + self.nsteps * self.step_vector
66+
return self.origin + (self.nsteps-1) * self.step_vector
6767

6868
def vtk(self):
6969
"""Convert the structured grid to a PyVista RectilinearGrid.
@@ -139,6 +139,7 @@ def cell_centres(self):
139139

140140
@property
141141
def nodes(self):
142+
142143
x = np.linspace(self.origin[0], self.maximum[0], self.nsteps[0])
143144
y = np.linspace(self.origin[1], self.maximum[1], self.nsteps[1])
144145
z = np.linspace(self.origin[2], self.maximum[2], self.nsteps[2])

0 commit comments

Comments
 (0)