GithubHelp home page GithubHelp logo

Comments (6)

user27182 avatar user27182 commented on June 16, 2024 1

remove_cells may be a good alternative to extract_cells. It has a PolyData to PolyData mapping. Though, the indices provided to these filters are kind of the inverse of each other. An alternative is to use vtkRemovePolyData for this purpose, this is what the connectivity filter currently uses under the hood for some cases.

Or, even using extract_surface would work, as suggested in #3009.

Not sure which implementation would be better to use. Some methods may alter the topology so probably whichever one best preserves the input data (e.g. correct cell winding, preserves orientation of the normals, ordering of cell ids, etc.

Having a PolyData to PolyData mapping for filters more generally is probably a good thing to add. It would eliminate the need to always cast the output back to PolyData if this kind of behavior was made standard for all DataSetFilters.
For example it would resolve this issue #5613.

Other filters such as extract_values, which also uses extract_cells under the hood and returns an UnstructuredGrid, would also benefit. E.g. #5968 uses extract_values but then has to call remove_cells to effectively cast the output back to PolyData. It would be nice to just get the PolyData output directly.

from pyvista.

darikg avatar darikg commented on June 16, 2024 1

it's always irked me that PolyData.extract_cells returns an UnstructuredGrid. Big +1 on fixing that if it's possible

from pyvista.

user27182 avatar user27182 commented on June 16, 2024

#6060 was recently patched into version 0.43.8, not sure if that affected the output. @kalingibbons do you get this same bug with 0.43.7 ?

from pyvista.

kalingibbons avatar kalingibbons commented on June 16, 2024

I was actually on 0.43.3 when I first ran into it, then updated to see if it was fixed before submitting the issue.

from pyvista.

user27182 avatar user27182 commented on June 16, 2024

Ah ok thanks for checking, I guess this bug has been there for a while then.

from pyvista.

MatthewFlamm avatar MatthewFlamm commented on June 16, 2024

when doing crinkle clip, it uses extract_cells under the hood. This is the reason that it returns UnstructuredGrid. I wonder if If should detect PolyData input and then cast appropriately.

https://docs.pyvista.org/version/stable/api/core/_autosummary/pyvista.DataSetFilters.extract_cells.html#pyvista.DataSetFilters.extract_cells

from pyvista.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.