Skip to content

Commit

Permalink
show disordered sites without gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmshn-ms committed Jan 2, 2025
1 parent 05b691b commit df3cdb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crystal_toolkit/renderables/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def get_site_scene(

radii = [legend.get_radius(sp, site=self) for sp in self.species]
max_radius = float(min(radii))

rscale_factor = 0.996
rscale = 1.0

for sp, occu in self.species.items():
if isinstance(sp, DummySpecie):
Expand Down Expand Up @@ -130,13 +133,14 @@ def get_site_scene(
sphere = Spheres(
positions=[position],
color=color,
radius=radius,
radius=radius * rscale,
phiStart=phiStart,
phiEnd=phiEnd,
clickable=True,
tooltip=name,
)
atoms.append(sphere)
rscale *= rscale_factor

# Add magmoms
if draw_magmoms and (magmom := self.properties.get("magmom")):
Expand All @@ -161,7 +165,7 @@ def get_site_scene(
sphere = Spheres(
positions=[position],
color="#ffffff",
radius=max_radius,
radius=max_radius * rscale_factor,
phiStart=phiEnd,
phiEnd=np.pi * 2,
)
Expand Down

0 comments on commit df3cdb2

Please sign in to comment.