summaryrefslogtreecommitdiff
path: root/viewpmt.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-06-18 00:12:09 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-06-18 00:12:09 -0400
commitab54917bceb4943f6750f589ffe6a032b2770fb1 (patch)
treee76ede76a1344820c424f2c07bc44ef22201864c /viewpmt.py
parent34ff4d6c734e5adf3aa8a0e7ca89031effdb1489 (diff)
downloadchroma-ab54917bceb4943f6750f589ffe6a032b2770fb1.tar.gz
chroma-ab54917bceb4943f6750f589ffe6a032b2770fb1.tar.bz2
chroma-ab54917bceb4943f6750f589ffe6a032b2770fb1.zip
moved class definitions for Solid, Mesh, Material, and Surface into geometry.py and moved instances of these classes into separate folders. the Solid object no longer contains a rotation, displacement, or id variable; instead, they are passed to a geometry object when calling add_solid().
Diffstat (limited to 'viewpmt.py')
-rw-r--r--viewpmt.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/viewpmt.py b/viewpmt.py
deleted file mode 100644
index 474b6d8..0000000
--- a/viewpmt.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import numpy as np
-from solid import Solid
-from mesh import mesh_from_stl
-from geometry import Geometry
-from view import view
-import models
-
-pmt_inner_mesh = \
- mesh_from_stl(models.dir + '/hamamatsu_12inch_inner.stl')
-pmt_outer_mesh = \
- mesh_from_stl(models.dir + '/hamamatsu_12inch_outer.stl')
-
-pmt_outer_mesh.triangles = \
- pmt_outer_mesh.triangles[np.mean(pmt_outer_mesh[:], axis=1)[:,0] > 0]
-
-photocathode_triangles = np.mean(pmt_inner_mesh[:], axis=1)[:,1] > 0
-
-inner_color = np.empty(len(pmt_inner_mesh.triangles), np.uint32)
-inner_color[photocathode_triangles] = 0xff0000
-inner_color[~photocathode_triangles] = 0x00ff00
-
-outer_color = np.empty(len(pmt_outer_mesh.triangles), np.uint32)
-outer_color[:] = 0xffffff
-
-geometry = Geometry([Solid(0, pmt_inner_mesh, color=inner_color),
- Solid(1, pmt_outer_mesh, color=outer_color)])
-
-geometry.build(bits=8)
-
-view(geometry)