Skip to content

Commit

Permalink
fix: sections can be painted with a feature
Browse files Browse the repository at this point in the history
or the model stratigraphy values
  • Loading branch information
Lachlan Grose committed Sep 21, 2021
1 parent 7c314a0 commit 905eeb1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LoopStructural/visualisation/model_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _add_vector_marker(self, location, vector, name, symbol_type='arrow',**kwarg
name of the object in the visualisation
"""
pass
def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
def add_section(self, geological_feature=None, axis='x', value=None, paint_with=None, **kwargs):
"""
Plot a section/map thru the model and paint with a geological feature
Expand Down Expand Up @@ -165,8 +165,11 @@ def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
name = 'nothing'
if geological_feature == 'model' and self.model is not None:
name = kwargs.get('name','model_section')
if paint_with == None:
paint_with = lambda xyz: self.model.evaluate_model(xyz,scale=False)
elif geological_feature is not None:
name = kwargs.get('name', geological_feature.name)
paint_with = geological_feature
name = '{}_section_at_{}_of_{}'.format(axis,value,name)
colour = kwargs.get('colour', 'red')

Expand All @@ -179,7 +182,7 @@ def add_section(self, geological_feature=None, axis='x', value=None, **kwargs):
# set the surface to be painted with the geological feature, but if a painter is specified, use that instead
# if 'paint_with' not in kwargs:
# kwargs['paint_with'] = geological_feature
self._add_surface(self.model.rescale(points,inplace=False),tri , name, colour=colour, **kwargs)
self._add_surface(self.model.rescale(points,inplace=False),tri , name, colour=colour, paint_with=paint_with, **kwargs)

def add_isosurface(self,
geological_feature,
Expand Down

0 comments on commit 905eeb1

Please sign in to comment.