tadd color to vtk files - sphere - GPU-based 3D discrete element method algorit… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 6d7378e8949c392dece9dbb1aec3d30bf8ef6c96 | |
parent 5c4f97d059e56e77b8455060aafacd54f2674c03 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 19 Jun 2014 10:43:39 +0200 | |
add color to vtk files | |
Diffstat: | |
M python/sphere.py | 9 +++++++++ | |
1 file changed, 9 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -1352,7 +1352,16 @@ class sim: | |
fh.write('\n') | |
fh.write(' </DataArray>\n') | |
+ # Color | |
+ fh.write(' <DataArray type="Int32" Name="Color" ' | |
+ + 'format="ascii">\n') | |
+ fh.write(' ') | |
+ for i in range(self.np): | |
+ fh.write('{} '.format(self.color[i])) | |
+ fh.write('\n') | |
+ fh.write(' </DataArray>\n') | |
+ # Footer | |
fh.write(' </PointData>\n') | |
fh.write(' <Cells>\n') | |
fh.write(' <DataArray type="Int32" Name="connectivity" ' |