Skip to content

Commit

Permalink
fix: change feature.scalar_field() from vtk type to structure grid
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Jun 5, 2024
1 parent dd54899 commit edadfb3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LoopStructural/modelling/features/_base_geological_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,14 @@ def scalar_field(self, bounding_box=None):
if self.model is None:
raise ValueError("Must specify bounding box")
bounding_box = self.model.bounding_box
grid = bounding_box.vtk()
grid = bounding_box.structured_grid(name=self.name)
value = self.evaluate_value(
self.model.scale(bounding_box.regular_grid(local=False, order='F'))
)
grid[self.name] = value
grid.properties_vertex[self.name] = value

value = self.evaluate_value(bounding_box.cell_centers(order='F'))
grid.properties_cell[self.name] = value
return grid

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

0 comments on commit edadfb3

Please sign in to comment.