Forum Navigation
You need to log in to create posts and topics.

How to show Voronoi polyhedra only for selected atom?

Dear Ovito developer,

I want to see the Voronoi polyhedra only for a specific atom, say atom number 1, and hide other polyhedra of other atoms.

Here I use the Expression Selection modifier to select all other atoms different from 1 (ParticleIndex!=1), and use the Delete Selected modifier to delete those atoms. Then I use Voronoi analysis modifier and select Generate Voronoi Polyhedra option to see the polyhedra.

As in the attached picture, I still see all other polyhedra though I delete all those atoms.  What I want to see is a polyhedra for atom 1 only, not all.  Is this option possible to do?

Thank you.

Uploaded files:
  • atom.png

Hi,

You can show only a particular Voronoi polyhedron by selecting and then deleting all others, similar to how you do it for the atoms.

  1. Insert the Expression Selection modifier into your pipeline (after the Voronoi Analysis modifier).
  2. Set the modifier to operate on "Voronoi polyhedra -> Mesh regions".
  3. Enter a Boolean expression such as ParticleIdentifier != 6.
  4. Insert the Delete Selected modifier into the pipeline.

This will hide all polyhedra for atoms other than atom ID == 6. Note that this approach requires adjusting the Boolean expression whenever the atom selection changes. If you would like to tie the polyhedra selection to the current atom selection, you'll need to employ a Python modifier function (a simple one-liner would be sufficient probably).

-Alex

Dear Alex,

Thank you. It works well, but I can't delete both the selected atoms and the selected polyhedra. I can only delete one of them. Is there a way I can delete both of them and keep only atom and polyhedra for atom ID==6?

I'm not sure how you mean that. OVITO does let you delete selected atoms and selected polyhedra at the same time. The Delete Selected modifier acts on the current particle selection and the current mesh selection (unless you tell it otherwise).

Please open the attached OVITO state file for a simple demonstration.

Uploaded files:

Dear Alex,

Everything works well now. Thank you very much.

新的OVITO微信频道!
New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.