Issue #325 resolved

Camera fails when normal_vector is in same direction as north_vector

James Guillochon
created an issue

Solution is to just have these two vectors in different directions, but it seems that the function should handle this situation more graceful. Here is the code snippet and traceback:

http://paste.yt-project.org/show/1945/

{{{

!python

Traceback (most recent call last): File "/share/work1/james/yt_scripts/volume.py", line 43, in <module> transfer_function=tf,pf=pf ,north_vector=up, no_ghost=False, sub_samples=10) File "/share/work1/james/local/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 204, in init self._setup_normalized_vectors(normal_vector, north_vector) File "/share/work1/james/local/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 250, in _setup_normalized_vectors File "/share/work1/james/local/yt-x86_64/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 1546, in pinv transfer_function=tf,pf=pf ,north_vector=up, no_ghost=False, sub_samples=10) }}}

Comments (8)

  1. James Guillochon reporter
    • changed status to open

    Through further testing, I've found that if the north_vector is anti-parallel to the normal_vector, the code also fails (For instance, (1, 0, 0) and (-1, 0, 0). So the check should be something like (pseudocode): if abs(north_vector dot normal_vector) = abs(north_vector * north_vector) ---> Print error message.

  2. Log in to comment