Skip to content

Commit edadfb3

Browse files
committed
fix: change feature.scalar_field() from vtk type to structure grid
1 parent dd54899 commit edadfb3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

LoopStructural/modelling/features/_base_geological_feature.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,14 @@ def scalar_field(self, bounding_box=None):
314314
if self.model is None:
315315
raise ValueError("Must specify bounding box")
316316
bounding_box = self.model.bounding_box
317-
grid = bounding_box.vtk()
317+
grid = bounding_box.structured_grid(name=self.name)
318318
value = self.evaluate_value(
319319
self.model.scale(bounding_box.regular_grid(local=False, order='F'))
320320
)
321-
grid[self.name] = value
321+
grid.properties_vertex[self.name] = value
322+
323+
value = self.evaluate_value(bounding_box.cell_centers(order='F'))
324+
grid.properties_cell[self.name] = value
322325
return grid
323326

324327
def vector_field(self, bounding_box=None, tolerance=0.05, scale=1.0):

0 commit comments

Comments
 (0)