Skip to content

Control points merging in the glyph filter#870

Merged
banesullivan merged 3 commits intopyvista:masterfrom
GuillaumeFavelier:feat/glyph_clean_parameter
Aug 18, 2020
Merged

Control points merging in the glyph filter#870
banesullivan merged 3 commits intopyvista:masterfrom
GuillaumeFavelier:feat/glyph_clean_parameter

Conversation

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor

This PR adds a clean parameter to control the preprocessing in the glyph filter.

It is now possible to do:

import numpy as np
import pyvista as pv

cells = np.array([[1, 0], [1, 1], [1, 2]])
cell_type = np.array([1, 1, 1])
points = np.array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])
vectors = np.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
grid = pv.UnstructuredGrid(cells, cell_type, points)
grid.point_arrays['vec'] = vectors

p = pv.Plotter()
p.add_mesh(grid.glyph(orient='vec', clean=False))
p.show()

to obtain:

image

Closes #869

@GuillaumeFavelier GuillaumeFavelier added the enhancement Changes that enhance the library label Aug 17, 2020
@GuillaumeFavelier GuillaumeFavelier self-assigned this Aug 17, 2020
@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

This is ready for reviews @pyvista/developers

Copy link
Copy Markdown
Member

@banesullivan banesullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if instead, we set tolerance to None by default and only run the clean filter if tolerance is not falsy?

@GuillaumeFavelier GuillaumeFavelier changed the title Add a clean parameter to the glyph filter Control points merging in the glyph filter Aug 18, 2020
@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

@banesullivan I modified glyph() to use the tolerance parameter instead but if we put tolerance=None it will change the default behaviour of the function right?

If it's not what you envisioned, feel free to let me know or push directly on the PR 👍

@banesullivan
Copy link
Copy Markdown
Member

I'd like to change the default behavior by making tolerance=None as the clean filter often takes a while to run and isn't always needed.

@GuillaumeFavelier
Copy link
Copy Markdown
Contributor Author

takes a while to run and isn't always needed.

I understand. I'll make it the default then

@banesullivan banesullivan merged commit 64e3435 into pyvista:master Aug 18, 2020
@GuillaumeFavelier GuillaumeFavelier deleted the feat/glyph_clean_parameter branch August 19, 2020 08:22
akaszynski added a commit that referenced this pull request Sep 2, 2020
* 🌐 Internationalization and localization.

* 🏷️ add tag to translate title

* Patch 6 (#3)

* typo fix (#864)

* ✏️ fix format of python code (#866)

* fix format of python code

We need 1 blank line before python code.

* fix format of python code

* fix format of python code

* fix format of python code

* fix format of python code

* Control points merging in the glyph filter (#870)

* Add clean paramter to the glyph filter

* Use tolerance parameter

* Set default tolerance=None

* Add RubberBand2D interactor style (#872)

* Add RubberBand2D interactor style

* Update testing

* Use format instead of fstring

* Enable smooth shading for textures (#865)

* ✏️ Fix typos. (#875)

* ✏️ Fix typos. (#876)

* ✏️ Fix typos.

* ✏️ Fix typos.

* 🌐 Internationalization and localization.

* 🏷️ add tag to translate title

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* Update docs/index.rst

Co-authored-by: Alex Kaszynski <akascap@gmail.com>

* small fix by review

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
Co-authored-by: Alex Kaszynski <akascap@gmail.com>
akaszynski added a commit that referenced this pull request Jan 22, 2021
* Patch 6 (#3)

* typo fix (#864)

* ✏️ fix format of python code (#866)

* fix format of python code

We need 1 blank line before python code.

* fix format of python code

* fix format of python code

* fix format of python code

* fix format of python code

* Control points merging in the glyph filter (#870)

* Add clean paramter to the glyph filter

* Use tolerance parameter

* Set default tolerance=None

* Add RubberBand2D interactor style (#872)

* Add RubberBand2D interactor style

* Update testing

* Use format instead of fstring

* Enable smooth shading for textures (#865)

* ✏️ Fix typos. (#875)

* ✏️ Fix typos. (#876)

* ✏️ Fix typos.

* ✏️ Fix typos.

* 🌐 Internationalization and localization.

* 🏷️ add tag to translate title

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>

* Patch 6 (#4)

* typo fix (#864)

* ✏️ fix format of python code (#866)

* fix format of python code

We need 1 blank line before python code.

* fix format of python code

* fix format of python code

* fix format of python code

* fix format of python code

* Control points merging in the glyph filter (#870)

* Add clean paramter to the glyph filter

* Use tolerance parameter

* Set default tolerance=None

* Add RubberBand2D interactor style (#872)

* Add RubberBand2D interactor style

* Update testing

* Use format instead of fstring

* Enable smooth shading for textures (#865)

* ✏️ Fix typos. (#875)

* ✏️ Fix typos. (#876)

* ✏️ Fix typos.

* ✏️ Fix typos.

* 🌐 Internationalization and localization.

* 🏷️ add tag to translate title

* Update docs/index.rst

Co-authored-by: Alex Kaszynski <akascap@gmail.com>

* small fix by review

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
Co-authored-by: Alex Kaszynski <akascap@gmail.com>

* 📷 Add test camera zoom and up

* 📷 Add camera zoom and up

* ♻️ Add Camera class

* ♻️ Add docstring

* ♻️ Add Camera class

* ♻️ Add Camera class

* ♻️ Fix arg name

* ♻️ Update Pythonic

* Fix error

* Fix error

* Fix error

* Change Camera class

inherit from vtkCamera

* Clean import

* Move the Camera class to its own file.

* Improve coverage with unit testing specific to the camera class

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
Co-authored-by: Alex Kaszynski <akascap@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Changes that enhance the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a clean parameter in the glyph filter

3 participants