From b0ab048d7bd4153dd0665ae3c9e7fadca15fe1fe Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Sat, 7 Jun 2014 18:15:08 +0000 Subject: [PATCH] now aware of "origin" keyword in seeds-file --- processing/pre/seeds_check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/processing/pre/seeds_check.py b/processing/pre/seeds_check.py index f75e067a9..11bfd81e3 100755 --- a/processing/pre/seeds_check.py +++ b/processing/pre/seeds_check.py @@ -92,6 +92,7 @@ for file in files: info = { 'grid': numpy.zeros(3,'i'), 'size': numpy.zeros(3,'d'), + 'origin': numpy.zeros(3,'d'), } for header in theTable.info: @@ -108,8 +109,8 @@ for file in files: info[headitems[0]] = mappings[headitems[0]](headitems[1]) file['croak'].write('grid a b c: %s\n'%(' x '.join(map(str,info['grid']))) + \ - 'size x y z: %s\n'%(' x '.join(map(str,info['size'])))) - + 'size x y z: %s\n'%(' x '.join(map(str,info['size']))) + \ + 'origin x y z: %s\n'%(' : '.join(map(str,info['origin'])))) if 0 not in options.grid: # user-specified grid info['grid'] = numpy.array(options.grid) if numpy.any(info['grid'] < 1): @@ -125,6 +126,7 @@ for file in files: #--- read data -------------------------------------------------------------------------------- theTable.data_readArray(['x','y','z','microstructure']) theTable.data[:,0:3] *= info['size'] + theTable.data[:,0:3] += info['origin'] #--- generate grid -------------------------------------------------------------------------------- grid = vtk.vtkUnstructuredGrid()