diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-16 17:07:52 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-08-16 17:07:52 -0400 |
commit | 54d7d1efe215337d121813e27cd4909b9a76e912 (patch) | |
tree | 7865db28adf2f9328fb9dcbbca8f8f125ecad40c /solids/pmts.py | |
parent | fd2e841c4c40f9e46258ac8d11c32c2204cddd5b (diff) | |
download | chroma-54d7d1efe215337d121813e27cd4909b9a76e912.tar.gz chroma-54d7d1efe215337d121813e27cd4909b9a76e912.tar.bz2 chroma-54d7d1efe215337d121813e27cd4909b9a76e912.zip |
add linear_extrude() function to make.py. rotate_extrude() now takes the number of rotational steps to extrude instead of the angle step size. updated documention in make.py.
Diffstat (limited to 'solids/pmts.py')
-rw-r--r-- | solids/pmts.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/solids/pmts.py b/solids/pmts.py index a30d007..fcbc8fc 100644 --- a/solids/pmts.py +++ b/solids/pmts.py @@ -25,11 +25,11 @@ def build_light_collector(pmt, a, b, d, rmin, rmax, npoints=10): lc_offset = np.interp(lc_radii[0], list(reversed(pmt_face_profile[:,0])), list(reversed(pmt_face_profile[:,1]))) - lc_mesh = rotate_extrude(lc_radii, lc_profile + lc_offset, pmt.theta) + lc_mesh = rotate_extrude(lc_radii, lc_profile + lc_offset, pmt.nsteps) return Solid(lc_mesh, pmt.outer_material, pmt.outer_material, surface=shiny_surface) -def build_pmt_shell(filename, outer_material=water, theta=np.pi/8): +def build_pmt_shell(filename, outer_material=water, nsteps=16): profile = read_csv(filename) # slice profile in half @@ -44,9 +44,9 @@ def build_pmt_shell(filename, outer_material=water, theta=np.pi/8): # convert mm -> m profile /= 1000.0 - return Solid(rotate_extrude(profile[:,0], profile[:,1], theta), glass, outer_material, color=0xeeffffff) + return Solid(rotate_extrude(profile[:,0], profile[:,1], nsteps), glass, outer_material, color=0xeeffffff) -def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8): +def build_pmt(filename, glass_thickness, outer_material=water, nsteps=16): profile = read_csv(filename) # slice profile in half @@ -63,8 +63,8 @@ def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8): offset_profile = offset(profile, -glass_thickness) - outer_envelope_mesh = rotate_extrude(profile[:,0], profile[:,1], theta) - inner_envelope_mesh = rotate_extrude(offset_profile[:,0], offset_profile[:,1], theta) + outer_envelope_mesh = rotate_extrude(profile[:,0], profile[:,1], nsteps) + inner_envelope_mesh = rotate_extrude(offset_profile[:,0], offset_profile[:,1], nsteps) outer_envelope = Solid(outer_envelope_mesh, glass, outer_material) @@ -78,16 +78,16 @@ def build_pmt(filename, glass_thickness, outer_material=water, theta=np.pi/8): # light collector pmt.profile = profile pmt.outer_material = outer_material - pmt.theta = theta + pmt.nsteps = nsteps return pmt -def build_light_collector_from_file(filename, outer_material, theta=np.pi/24): +def build_light_collector_from_file(filename, outer_material, nsteps=48): profile = read_csv(filename) # Convert mm to m profile /= 1000.0 - mesh = rotate_extrude(profile[:,0], profile[:,1], theta) + mesh = rotate_extrude(profile[:,0], profile[:,1], nsteps) solid = Solid(mesh, outer_material, outer_material, surface=shiny_surface) return solid |