Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add other views to
Camera.tight
(#3391)
* refactor view_xyz, allow reuse of calculating view_vectors * add multiple views to tight * Typo fix Co-authored-by: Andras Deak <adeak@users.noreply.github.com> * fix naming to fix high variance image regression filtering * Apply suggestions from code review Co-authored-by: Andras Deak <adeak@users.noreply.github.com> * fix return types * better description of view planes * fix negative issue for view_* * move view_vectors in helpers and fix circular import * use objects center as focal point, and offset by 1 * simplify absolute and dot products * move test_tight_direction to be near other tight_* tests * test for multiple objects when using tight * Apply suggestions from code review: Comment clarifications Co-authored-by: Andras Deak <adeak@users.noreply.github.com> * Use parallel projection in docstring in tight * add tests specifically for view_vectors * don't use names in returns section * Update pyvista/plotting/helpers.py Co-authored-by: Andras Deak <adeak@users.noreply.github.com> Co-authored-by: Alex Kaszynski <akascap@gmail.com>
- Loading branch information
1 parent
f9dd706
commit 8683da1
Showing
31 changed files
with
189 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"""Tests for plotting helpers.""" | ||
|
||
import numpy as np | ||
import pytest | ||
|
||
from pyvista.plotting.helpers import view_vectors | ||
|
||
|
||
def test_view_vectors(): | ||
views = ('xy', 'yx', 'xz', 'zx', 'yz', 'zy') | ||
|
||
for view in views: | ||
vec, viewup = view_vectors(view) | ||
assert isinstance(vec, np.ndarray) | ||
assert np.array_equal(vec.shape, (3,)) | ||
assert isinstance(viewup, np.ndarray) | ||
assert np.array_equal(viewup.shape, (3,)) | ||
|
||
with pytest.raises(ValueError, match="Unexpected value for direction"): | ||
view_vectors('invalid') |
Oops, something went wrong.