Repository navigation
Draw ionic ball_stick coordination sticks on the wrapped unit cell - #244
SchrodingersCattt wants to merge 4 commits into
Conversation
Extended ionic and inorganic unit-cell views were drawing a one-sided coordination shell, such as NaCl Cl at fractional -0.5, from spanning-bond context. Display those lattices as wrapped crystallographic sites plus symmetric 0/1 boundary images. Co-authored-by: Ming-Yu Guo <guomy26@mail2.sysu.edu.cn>
SchrodingersCattt
left a comment
There was a problem hiding this comment.
Review @ 927a95fa (pending CI)
Looks right for #238.
- Ionic contacts stay in
scene["bonds"](suppressed_ionic_bond_count == 0); ball/space_filling still don’t stroke them. - Half-cell MIC tie in
_bond_endpointskeeps both ±a/2 arms of the octahedron instead of doubling one image. coordination_stick_radius+ lattice ball radii give spheres larger than sticks; omitted--style→ballfor ionic/inorganic matches the viewer.- Regression suite in
tests/render/test_ionic_coordination_sticks.py(CN=6, equal axes, omitted-style default) is solid. - PR body keywords are safe (
Closes #238; “does not address #239”).
Merge note vs open #243: both touch scene/core.py and tests/test_inorganic_defaults.py. #244 still expects CIF NaCl draw_atoms == 4 (spanning-bond shell); #243 rewrites that path to wrapped lattice sites (12). Prefer merge #243 first, then rebase #244 onto main so the inorganic defaults assertion follows the new site contract.
Waiting on GHA 9/9. Will not squash until you say so.
|
User feedback (needs-changes): the acceptance PNG is still a one-sided corner blob (structure clustered bottom-left; top-right of the cell empty). That is not acceptable. Wanted instead:
CN=6 octahedral sticks, sphere>stick radii, and omitted- |
Binary alkali-halide contacts stay in the visible bond list, and a half-cell neighbour keeps its manifested endpoint so each site shows all six Fm-3m arms. An omitted CLI --style follows the viewer lattice default of ball on the unit cell. Co-authored-by: Ming-Yu Guo <guomy26@mail2.sysu.edu.cn>
Move omitted-style resolution next to the other render CLI controls. A 2x2x2 repeat of the one-dimensional NaCl contact includes the junction bonds between repeated cells. Co-authored-by: Ming-Yu Guo <guomy26@mail2.sysu.edu.cn>
Lattice-site centres stay inside the closed cell, including the 0/1 boundary images. First neighbors that have no sphere there are sticks ending at the image coordinate, so each home site keeps six octahedral arms and the exterior ends are inversion-symmetric. Co-authored-by: Ming-Yu Guo <guomy26@mail2.sysu.edu.cn>
927a95f to
a712c65
Compare
SchrodingersCattt
left a comment
There was a problem hiding this comment.
Re-review @ a712c652 (pending CI) — addresses the one-sided corner blob.
- Acceptance PNG is now box-centered: wrapped sites + symmetric 0/1 replicas; sticks to exterior image ends appear on every symmetry-equivalent face.
- Tests assert centres in
[0, 1], inversion + cubic closure for both centres and stick endpoints, CN=6, and no framework/bonded-image shell. - Branch includes #243’s lattice-site commit; land #243 first, then this.
- Keywords OK (
Closes #238; dependency on #243 stated without auto-close phrasing).
Waiting on GHA 9/9. Will not squash until you say so.
|
Closing without merge: owner review found the change rocksalt-specific (NaCl octahedral CN=6 tests/acceptance/comments; stick geometry comments hard-coded around rocksalt). Redo as a general ionic lattice |
Summary
Explicit
--style ball_stickon conventional ionic / inorganic unit cells draws coordination sticks on the same wrapped lattice-site layout as #243: centres stay in[0, 1](crystallographic sites plus the symmetric face, edge, and corner images at 0 and 1). There is no one-sided coordination shell at fractional-0.5.Each home site still has its first-neighbor coordination (CN=6 along ±a/2 for rocksalt NaCl). A neighbor with no sphere inside the closed cell is a stick ending at that image coordinate. Those exterior ends are closed under inversion through the cell centre and under cubic axis permutation, so a blob on one corner fails the regression. Atom spheres stay larger than the sticks.
Ball and space-filling styles do not stroke those contacts. When
--styleis omitted, ionic and inorganic lattices still useballandunit_cell.Based on the lattice-site layout now on main from #243 (
bc2515f).Closes #238
Acceptance
ASE
bulk('NaCl', 'rocksalt', a=5.6402, cubic=True)written as a VASP POSCAR:mat-vis render POSCAR_NaCl -o nacl_bs.png \ --backend cpu --orthogonal --background '#FFFFFF' --style ball_stick --jsonCentered rocksalt NaCl ball-and-stick unit cell
Tests
tests/render/test_ionic_coordination_sticks.pychecks CN=6, equal axis counts, centres inside the closed cell, and inversion plus cubic symmetry of both centres and stick endpoints.ball.To show artifacts inline, enable in settings.