Voronoi Analysis

Dear Ovito members,

I am contacting you because I want to combine Python and Ovito to do Voronoi analysis on a configuration of 5000 polydisperse particles closed in a cubic simulation box with periodic boundary conditions. In particular, I would like to compute the Cavity Radius. However, I need help finding out how. At the moment, I am doing the following:

def assign_particle_radii(frame, data):
    atom_types = data.particles_.particle_types_
    atom_types.type_by_id_(1).radius = 0.42
    atom_types.type_by_id_(2).radius = 0.475
    atom_types.type_by_id_(3).radius = 0.50
    atom_types.type_by_id_(4).radius = 0.56

pipeline = import_file(input)
celldata = pipeline.compute()
pipeline.source.data.cell_.pbc = (True,True,True)

voro = VoronoiAnalysisModifier(
       compute_indices = True,
       use_radii = True,
       edge_threshold = 0.1,

data = pipeline.compute()

voro_volume = data.particles['Atomic Volume']
voro_cavity = data.particles['Cavity Radius']

However, it seems that ‘Cavity Radius’ is not contained in data.particles. Could you indicate or provide me with information about what I should introduce in data.particles to compute the cavity radius?

Thank you so much in advance for your time.


Are you using an OVITO version >= 3.7.9? The cavity radius calculation feature has been added to the Voronoi Analysis modifier in Sep 2022. https://www.ovito.org/docs/current/new_features.html#version-3-7-9-12-sep-2022

I am using OVITO version 3.7.12

I have reinstalled the version, and now I can do it.
To be sure, version 3.7.12 no longer introduces a factor of two in the cavity calculation, right?

Thank you very much for your help!

Yes, that’s correct. Changelog — OVITO User Manual 3.9.2 documentation