Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all-triangles checking for polyfilters #2934

Merged
merged 5 commits into from
Jul 6, 2022

Conversation

adeak
Copy link
Member

@adeak adeak commented Jul 3, 2022

We have a few filters that need all-triangle meshes (and this is even documented), but there was no check for this.

The result for non-triangular meshes varies, e.g.

>>> import pyvista as pv
>>> pv.Cube().decimate(0.5)
2022-07-03 17:48:56.522 (   6.404s) [        1C510740]vtkQuadricDecimation.cx:214    ERR| vtkQuadricDecimation (0x2b11330): Can only decimate triangles
ERROR:root:Can only decimate triangles
PolyData (0x7fde1bfa6dc0)
  N Cells:	0
  N Points:	0
  X Bounds:	1.000e+299, -1.000e+299
  Y Bounds:	1.000e+299, -1.000e+299
  Z Bounds:	1.000e+299, -1.000e+299
  N Arrays:	0
>>> pv.Cube().decimate_pro(0.5)
2022-07-03 17:49:09.501 (  19.383s) [        1C510740]     vtkDecimatePro.cxx:191    ERR| vtkDecimatePro (0x2b11330): DecimatePro does not accept polygons that are not triangles.
ERROR:root:DecimatePro does not accept polygons that are not triangles.
PolyData (0x7fddfd94fdc0)
  N Cells:	6
  N Points:	8
  X Bounds:	-5.000e-01, 5.000e-01
  Y Bounds:	-5.000e-01, 5.000e-01
  Z Bounds:	-5.000e-01, 5.000e-01
  N Arrays:	3

@adeak adeak added the bug Uh-oh! Something isn't working as expected. label Jul 3, 2022
@codecov
Copy link

codecov bot commented Jul 3, 2022

Codecov Report

Merging #2934 (051122a) into main (b12340a) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
+ Coverage   94.07%   94.28%   +0.20%     
==========================================
  Files          76       76              
  Lines       16534    16506      -28     
==========================================
+ Hits        15555    15562       +7     
+ Misses        979      944      -35     

banesullivan
banesullivan previously approved these changes Jul 3, 2022
@akaszynski akaszynski merged commit 364f8a4 into pyvista:main Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants