[yt-svn] commit/yt: chummels: Merged in jisuoqing/yt (pull request #1819)
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Oct 21 18:19:39 PDT 2015
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/1d18fbb16ffd/
Changeset: 1d18fbb16ffd
Branch: yt
User: chummels
Date: 2015-10-21 19:57:29+00:00
Summary: Merged in jisuoqing/yt (pull request #1819)
[experimental] [bugfix] Reshape zbuffer for non-plane-parallel lenses, fix #1122
Affected #: 1 file
diff -r e0ba8789d21ad41eb928ce34296ae4677e8d4a33 -r 1d18fbb16ffdb55b98e4cd4b1feed099da4bb6c9 yt/visualization/volume_rendering/render_source.py
--- a/yt/visualization/volume_rendering/render_source.py
+++ b/yt/visualization/volume_rendering/render_source.py
@@ -501,8 +501,19 @@
# DRAW SOME POINTS
camera.lens.setup_box_properties(camera)
px, py, dz = camera.lens.project_to_plane(camera, vertices)
+
+ # Non-plane-parallel lenses only support 1D array
+ # 1D array needs to be transformed to 2D to get points plotted
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0], camera.resolution[1], 4)
+ z.shape = (camera.resolution[0], camera.resolution[1])
+
zpoints(empty, z, px.d, py.d, dz.d, self.colors, self.color_stride)
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0] * camera.resolution[1], 1, 4)
+ z.shape = (camera.resolution[0] * camera.resolution[1], 1)
+
self.zbuffer = zbuffer
return zbuffer
@@ -616,8 +627,19 @@
# DRAW SOME LINES
camera.lens.setup_box_properties(camera)
px, py, dz = camera.lens.project_to_plane(camera, vertices)
+
+ # Non-plane-parallel lenses only support 1D array
+ # 1D array needs to be transformed to 2D to get lines plotted
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0], camera.resolution[1], 4)
+ z.shape = (camera.resolution[0], camera.resolution[1])
+
zlines(empty, z, px.d, py.d, dz.d, self.colors, self.color_stride)
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0] * camera.resolution[1], 1, 4)
+ z.shape = (camera.resolution[0] * camera.resolution[1], 1)
+
self.zbuffer = zbuffer
return zbuffer
@@ -884,8 +906,19 @@
z = zbuffer.z
# Draw the vectors
+
+ # Non-plane-parallel lenses only support 1D array
+ # 1D array needs to be transformed to 2D to get lines plotted
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0], camera.resolution[1], 4)
+ z.shape = (camera.resolution[0], camera.resolution[1])
+
zlines(empty, z, px.d, py.d, dz.d, self.colors, self.color_stride)
+ if 'plane-parallel' not in str(camera.lens):
+ empty.shape = (camera.resolution[0] * camera.resolution[1], 1, 4)
+ z.shape = (camera.resolution[0] * camera.resolution[1], 1)
+
# Set the new zbuffer
self.zbuffer = zbuffer
return zbuffer
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list