pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
59 stars 4 forks source link

Mask/Remove Voxels in Air (small intersection with surface) #519

Closed abbas-tari closed 2 years ago

abbas-tari commented 2 years ago

Hi all - My question is about the voxelize function. I do the voxelization for a simple shape and in the end, there are some voxels which only small portion of them touches the surface and the most volume is the air as it is shown below. Is there any way we could remove/mask (or detect) these voxels as they only have very small intersection with the surface?

RichardScottOZ commented 2 years ago

If your surface is a plane, you can clip to that - so you can end up with a dataset either way.

abbas-tari commented 2 years ago

Thanks. I wasn't aware of clipping. I solved it with another way in which if center points of the voxels aren't enclosed within the surface, they will be discarded. This was enough for me, however your approach is more elegant.

RichardScottOZ commented 2 years ago

Ok, good. You can close this one?