Venkatesh B
Venkatesh B

Reputation: 11

Extract all the cells that are touching an Object in PyVista

I have a pv.PolyData object like this.

PolyData (0x78cbbcc6ba00)
  N Cells:    1280
  N Points:   642
  N Strips:   0
  X Bounds:   2.346e-01, 9.625e-01
  Y Bounds:   -2.296e-01, 5.064e-01
  Z Bounds:   -1.066e-02, 3.016e-01
  N Arrays:   0

And I have a pv.UnstrcutredGrid object like this.

UnstructuredGrid (0x78cbbcc6b520)
  N Cells:    60835
  N Points:   16652
  X Bounds:   -1.329e+00, 1.329e+00
  Y Bounds:   -1.329e+00, 1.329e+00
  Z Bounds:   -1.338e+00, 1.338e+00
  N Arrays:   0

I want to extract all the cells in the pv.UnstrcturedGrid object that are touching the pv.PolyData object.

One more detail, the UnstructuredGrid cells are not at all phasing thorough polydata object or clipping inside it, or glitching inside the polydata, no such things. it is only touching. I want to extract all the cells that are touching the polydata object.

The polydata object is a closed surface in every case.

How can I do it?

Thanks in advance.

Upvotes: 0

Views: 28

Answers (0)

Related Questions