Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Show disordered sites without gaps #441

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crystal_toolkit/renderables/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,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):
cube = Cubes(
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
Loading