summaryrefslogtreecommitdiff
path: root/solids/r7081.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-06-20 16:33:59 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-06-20 16:33:59 -0400
commit5b6ddaadfbcea436dfdc1e736f7da7763438dc45 (patch)
tree27d3f4d3903d2cd00449026acd23ad6de1419cd5 /solids/r7081.py
parenta149f96a766c4d8d63919535cc468c539036165e (diff)
downloadchroma-5b6ddaadfbcea436dfdc1e736f7da7763438dc45.tar.gz
chroma-5b6ddaadfbcea436dfdc1e736f7da7763438dc45.tar.bz2
chroma-5b6ddaadfbcea436dfdc1e736f7da7763438dc45.zip
pack material and surface indices into the fourth byte of the triangle array on the GPU. you can now take a screenshot of an image rendered with view.py() by pressing the f12 key.
Diffstat (limited to 'solids/r7081.py')
-rw-r--r--solids/r7081.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/solids/r7081.py b/solids/r7081.py
index af9c2f0..ed677d8 100644
--- a/solids/r7081.py
+++ b/solids/r7081.py
@@ -27,3 +27,22 @@ r7081_inner_solid = Solid(r7081_inner_mesh, vacuum, glass, inner_surface, color=
r7081_outer_solid = Solid(r7081_outer_mesh, glass, lightwater_sno)
r7081 = r7081_inner_solid + r7081_outer_solid
+
+if __name__ == '__main__':
+ from view import view
+ from copy import deepcopy
+
+ r7081_outer_mesh_cutaway = deepcopy(r7081_outer_mesh)
+ r7081_outer_mesh_cutaway.triangles = \
+ r7081_outer_mesh_cutaway.triangles[\
+ np.mean(r7081_outer_mesh_cutaway[:], axis=1)[:,0] > 0]
+
+ r7081_outer_solid_cutaway = Solid(r7081_outer_mesh_cutaway, glass, lightwater_sno)
+
+ r7081_cutaway = r7081_inner_solid + r7081_outer_solid_cutaway
+
+ geometry = Geometry()
+ geometry.add_solid(r7081_cutaway)
+ geometry.build(bits=8)
+
+ view(geometry, 'r7081_cutaway')