unit-cell-gui 0.2.3__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/CHANGELOG.md +80 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/CITATION.cff +2 -2
- unit_cell_gui-0.2.5/MANIFEST.in +15 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/PKG-INFO +141 -1
- unit_cell_gui-0.2.5/README.md +318 -0
- unit_cell_gui-0.2.5/RELEASE_NOTES_0.2.4.md +77 -0
- unit_cell_gui-0.2.5/RELEASE_NOTES_0.2.5.md +113 -0
- unit_cell_gui-0.2.5/docs/hybrid-transparency.md +143 -0
- unit_cell_gui-0.2.5/docs/partial-updates.md +139 -0
- unit_cell_gui-0.2.5/examples/partial_updates.py +60 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/pyproject.toml +1 -1
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/__init__.py +1 -1
- unit_cell_gui-0.2.5/src/unit_cell_gui/_contacts.py +80 -0
- unit_cell_gui-0.2.5/src/unit_cell_gui/_numeric.py +138 -0
- unit_cell_gui-0.2.5/src/unit_cell_gui/_scene_updates.py +135 -0
- unit_cell_gui-0.2.5/src/unit_cell_gui/_spatial.py +84 -0
- unit_cell_gui-0.2.5/src/unit_cell_gui/_transparency_sort.py +371 -0
- unit_cell_gui-0.2.5/src/unit_cell_gui/_weighted_oit.py +256 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/gl_geometry.py +11 -1
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/hatching.py +2 -4
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/models.py +26 -11
- unit_cell_gui-0.2.5/src/unit_cell_gui/opengl_viewer.py +3402 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui.egg-info/PKG-INFO +141 -1
- unit_cell_gui-0.2.5/src/unit_cell_gui.egg-info/SOURCES.txt +58 -0
- unit_cell_gui-0.2.5/tests/render_test_helpers.py +26 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/tests/test_unit_cell_gui.py +7 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/tests/test_visibility_cache.py +26 -7
- unit_cell_gui-0.2.5/tests/test_z_audit.py +340 -0
- unit_cell_gui-0.2.5/tests/test_z_contact_colours.py +112 -0
- unit_cell_gui-0.2.5/tests/test_z_opacities.py +139 -0
- unit_cell_gui-0.2.5/tests/test_z_outline_instancing.py +171 -0
- unit_cell_gui-0.2.5/tests/test_z_scene_instancing.py +201 -0
- unit_cell_gui-0.2.5/tests/test_z_transparency_sort.py +218 -0
- unit_cell_gui-0.2.5/tests/test_z_updates.py +225 -0
- unit_cell_gui-0.2.5/tests/test_z_weighted_oit.py +423 -0
- unit_cell_gui-0.2.5/validation/README.md +130 -0
- unit_cell_gui-0.2.5/validation/benchmark_dense_sort.py +39 -0
- unit_cell_gui-0.2.5/validation/benchmark_sort.py +112 -0
- unit_cell_gui-0.2.5/validation/benchmark_transparency.py +101 -0
- unit_cell_gui-0.2.5/validation/benchmark_updates.py +132 -0
- unit_cell_gui-0.2.5/validation/benchmark_weighted_oit.py +191 -0
- unit_cell_gui-0.2.5/validation/check_installed.py +67 -0
- unit_cell_gui-0.2.5/validation/prototype_weighted_oit.py +79 -0
- unit_cell_gui-0.2.5/validation/render_regression_scenes.py +117 -0
- unit_cell_gui-0.2.3/MANIFEST.in +0 -8
- unit_cell_gui-0.2.3/README.md +0 -178
- unit_cell_gui-0.2.3/src/unit_cell_gui/opengl_viewer.py +0 -2156
- unit_cell_gui-0.2.3/src/unit_cell_gui.egg-info/SOURCES.txt +0 -29
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/LICENSE +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/RELEASE_NOTES_0.2.2.md +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/RELEASE_NOTES_0.2.3.md +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/THIRD_PARTY_NOTICES.txt +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/setup.cfg +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/py.typed +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/qt_config.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/render_geometry.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/view_helpers.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui/viewer.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui.egg-info/dependency_links.txt +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui.egg-info/requires.txt +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/src/unit_cell_gui.egg-info/top_level.txt +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/tests/test_gl_geometry.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/tests/test_render_geometry.py +0 -0
- {unit_cell_gui-0.2.3 → unit_cell_gui-0.2.5}/tests/test_z_atom_instancing.py +0 -0
|
@@ -1,5 +1,85 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.5 - 2026-10-19
|
|
4
|
+
|
|
5
|
+
Changes since the published 0.2.4 release:
|
|
6
|
+
|
|
7
|
+
- Add indexed external polyhedron opacity updates without mesh rebuilds.
|
|
8
|
+
- Sort transparent faces and physical edges together using projected overlap
|
|
9
|
+
depth, preserving native Qt MSAA without depth peeling or supersampling.
|
|
10
|
+
- Add independent per-widget WBOIT-during-rotation and permanent WBOIT options
|
|
11
|
+
through Shift + right-button menu and trailing DisplayOptions fields.
|
|
12
|
+
- Permanent WBOIT takes priority; rotation-only mode returns to sorted rendering
|
|
13
|
+
on release or after 150 ms of external orientation inactivity. Preserve signals,
|
|
14
|
+
ordinary pan/zoom and engraving; include nonfatal fallback and resource limits.
|
|
15
|
+
- Cache world geometry/material keys/normals; prune projected candidates and
|
|
16
|
+
bound clipping batches. Index atoms/polyhedron bounds and cache contact frames.
|
|
17
|
+
- Make opacity-only state lazy, update host polyhedron styles locally and cache
|
|
18
|
+
legend entries using visible components.
|
|
19
|
+
- Validate integer indices, GPU float32 input/derived ranges and invertible,
|
|
20
|
+
well-conditioned orientations; stabilize very large occupancy weights.
|
|
21
|
+
- Free resources on shader failures and scene clear; restore normal close/show.
|
|
22
|
+
- Add state, fault, GL lifecycle and numerical regressions, plus separate CPU,
|
|
23
|
+
GPU, frame-interval and dense-graph diagnostics. Dependencies are unchanged.
|
|
24
|
+
|
|
25
|
+
See RELEASE_NOTES_0.2.5.md for the complete release relative to GitHub 0.2.4.
|
|
26
|
+
|
|
27
|
+
## 0.2.4 - 2026-10-13
|
|
28
|
+
|
|
29
|
+
Changes since 0.2.3:
|
|
30
|
+
|
|
31
|
+
- Instance camera-facing atom outlines, coloured half-bonds, polyhedron fill
|
|
32
|
+
triangles, physical edges and engraving bonds using shared meshes.
|
|
33
|
+
- Keep geometry resident during camera changes; update edge sorting through
|
|
34
|
+
compact index lists and split large texture buffers at driver limits.
|
|
35
|
+
- Add atomic indexed external updates for atom positions/visibility and
|
|
36
|
+
polyhedron replacement, with effective-state getters and reset.
|
|
37
|
+
- Patch affected atom records and existing adjacent bonds; give modified
|
|
38
|
+
polyhedra independent buffers and refresh dependent section/hatch caches.
|
|
39
|
+
- Match atom/face intersection curves to the face colour in coloured mode,
|
|
40
|
+
including polyhedron colour overrides; retain black ink in engraving mode.
|
|
41
|
+
- Refresh contact colours after display-mode, style or polyhedron changes.
|
|
42
|
+
- Preserve input Scene, camera, existing API/models, line widths, intact-polygon
|
|
43
|
+
hatching and OpenGL 3.3 support. Add documentation and an external-control example.
|
|
44
|
+
|
|
45
|
+
## 0.2.3.03 - 2026-10-13 (local experiment)
|
|
46
|
+
|
|
47
|
+
- Add atomic indexed `update_scene` packets, atom coordinate/visibility setters,
|
|
48
|
+
polyhedron updates, reset and effective-state getters.
|
|
49
|
+
- Keep original Scene data and camera unchanged; preserve host style restrictions.
|
|
50
|
+
- Patch only changed atom/outline rows and existing adjacent bond records.
|
|
51
|
+
- Give replaced polyhedra independent buffers; refresh only dependent sections
|
|
52
|
+
and hatching, preserving intact faces, transparency ordering and line styles.
|
|
53
|
+
- Retain clipped stable slots for hidden atoms and degenerate bonds.
|
|
54
|
+
- Coalesce GPU updates until paint and release dynamic resources with scene/context.
|
|
55
|
+
- Include an external-control example and preserve existing API signatures.
|
|
56
|
+
- Python packaging normalizes `0.2.3.03` to `0.2.3.3`.
|
|
57
|
+
|
|
58
|
+
## 0.2.3.02 - 2026-10-12 (local experiment)
|
|
59
|
+
|
|
60
|
+
- Render coloured half-bonds with one shared indexed cylinder.
|
|
61
|
+
- Render polyhedron fill triangles, physical edges and engraving bonds
|
|
62
|
+
with shared primitives and compact instance records.
|
|
63
|
+
- Preserve face/edge transparency ordering, physical shared-edge deduplication,
|
|
64
|
+
lighting, line widths, antialiasing and depth offsets on OpenGL 3.3.
|
|
65
|
+
- Batch depth-sorted edges with a small integer order list while keeping
|
|
66
|
+
coordinates and colours resident.
|
|
67
|
+
- Split primitive instance storage at the driver's texture-buffer limit.
|
|
68
|
+
- Keep hatching and atom/face intersections unchanged; retain intact polygon
|
|
69
|
+
faces for hatching and preserve the public API.
|
|
70
|
+
- Extend GL resource cleanup and reinitialization for the new passes.
|
|
71
|
+
- Python packaging normalizes `0.2.3.02` to `0.2.3.2`.
|
|
72
|
+
|
|
73
|
+
## 0.2.3.01 - 2026-10-08 (local experiment)
|
|
74
|
+
|
|
75
|
+
- Render camera-facing atom silhouettes with a shared instanced ring.
|
|
76
|
+
- Keep outline instance buffers resident during rotation, zoom and resize;
|
|
77
|
+
update camera transforms and cosmetic radius padding in the vertex shader.
|
|
78
|
+
- Preserve solid/dashed outlines, depth testing, antialiasing and the existing
|
|
79
|
+
order relative to opaque and transparent scene geometry.
|
|
80
|
+
- Clean up and recreate all new GL resources with the viewer context.
|
|
81
|
+
- Python distribution metadata normalizes this version to `0.2.3.1`.
|
|
82
|
+
|
|
3
83
|
## 0.2.3 - 2026-10-06
|
|
4
84
|
|
|
5
85
|
### Performance
|
|
@@ -8,7 +8,7 @@ authors:
|
|
|
8
8
|
repository-code: https://github.com/ofussr/unit-cell-gui
|
|
9
9
|
url: https://github.com/ofussr/unit-cell-gui
|
|
10
10
|
orcid: https://orcid.org/0000-0002-5571-8525
|
|
11
|
-
version: 0.2.
|
|
12
|
-
date-released: 2026-10-
|
|
11
|
+
version: 0.2.5
|
|
12
|
+
date-released: 2026-10-19
|
|
13
13
|
doi: 10.5281/zenodo.22714946
|
|
14
14
|
license: MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
include CHANGELOG.md
|
|
2
|
+
include CITATION.cff
|
|
3
|
+
include LICENSE
|
|
4
|
+
include README.md
|
|
5
|
+
include RELEASE_NOTES_0.2.2.md
|
|
6
|
+
include RELEASE_NOTES_0.2.3.md
|
|
7
|
+
include RELEASE_NOTES_0.2.4.md
|
|
8
|
+
include RELEASE_NOTES_0.2.5.md
|
|
9
|
+
include THIRD_PARTY_NOTICES.txt
|
|
10
|
+
recursive-include tests *.py
|
|
11
|
+
exclude LOCAL_NOTES_*.md
|
|
12
|
+
recursive-include docs *.md
|
|
13
|
+
recursive-include examples *.py
|
|
14
|
+
recursive-include validation *.py *.md
|
|
15
|
+
exclude RELEASE_NOTES_0.2.5.*.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unit-cell-gui
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: PySide6 widget for rendering caller-supplied unit-cell scenes
|
|
5
5
|
Author-email: Mikhail Mirushchenko <miruschenko98@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -111,6 +111,13 @@ therefore cannot alter an already submitted scene.
|
|
|
111
111
|
camera coordinate is `orientation @ world`; the renderer's row arrays use the
|
|
112
112
|
equivalent `world @ orientation.T`.
|
|
113
113
|
|
|
114
|
+
Matrices must be finite and float32-representable, remain invertible after
|
|
115
|
+
float32 rounding, and have condition number below 1e6. Their inverse and
|
|
116
|
+
conservative generated/transformed geometry bounds must also fit float32.
|
|
117
|
+
Reflections and general well-conditioned invertible matrices remain accepted;
|
|
118
|
+
SO(3) orthogonality is not required. Invalid input leaves the previous state
|
|
119
|
+
unchanged and does not emit a signal.
|
|
120
|
+
|
|
114
121
|
Programmatic changes are silent by default:
|
|
115
122
|
|
|
116
123
|
```python
|
|
@@ -194,3 +201,136 @@ If you use `unit-cell-gui` in academic work, please cite the Zenodo record:
|
|
|
194
201
|
[](https://doi.org/10.5281/zenodo.22714946)
|
|
195
202
|
|
|
196
203
|
You can also use the metadata provided in [`CITATION.cff`](CITATION.cff).
|
|
204
|
+
|
|
205
|
+
## Shared GPU geometry (0.2.4)
|
|
206
|
+
|
|
207
|
+
Atoms, camera-facing outlines, coloured bonds, polyhedron fill triangles,
|
|
208
|
+
physical edges and engraving bonds use shared meshes and instance records.
|
|
209
|
+
Camera changes keep geometry resident; depth-sorted edges update compact
|
|
210
|
+
index lists. Large arrays are split at the driver's texture-buffer limit.
|
|
211
|
+
Sphere tessellation remains 720 triangles per atom; no LOD is applied.
|
|
212
|
+
|
|
213
|
+
Hatching uses intact polygons and the existing stroke algorithm. In coloured mode, atom/face
|
|
214
|
+
intersection curves use the corresponding face colour, including polyhedron
|
|
215
|
+
colour overrides. Engraving keeps black intersection ink.
|
|
216
|
+
|
|
217
|
+
## External partial updates (0.2.4)
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
viewer.update_scene(
|
|
221
|
+
atom_positions={17: (x, y, z)},
|
|
222
|
+
atom_visibility={42: False},
|
|
223
|
+
polyhedra={3: updated_polyhedron},
|
|
224
|
+
polyhedron_opacities={3: 0.35},
|
|
225
|
+
)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Original scene indices stay stable; positions are absolute Cartesian XYZ.
|
|
229
|
+
Packets are validated atomically, copied and uploaded on the next paint.
|
|
230
|
+
Only changed atoms, their existing adjacent bonds and affected polyhedra are
|
|
231
|
+
updated; dependent sections and hatching refresh as needed.
|
|
232
|
+
|
|
233
|
+
`set_atom_positions`, `set_atom_visibility` and `update_polyhedra` provide
|
|
234
|
+
individual setters. `reset_scene_updates()` restores input geometry and local
|
|
235
|
+
visibility while preserving camera and host styles. Effective-state getters
|
|
236
|
+
are `get_atom_positions()`, `get_atom_visibility()` and `get_polyhedra()`.
|
|
237
|
+
|
|
238
|
+
`viewer.scene` remains the original object; `set_scene()` clears the overrides.
|
|
239
|
+
Call updates on the GUI thread. The host supplies updated polyhedra and bond
|
|
240
|
+
topology; neither is inferred automatically. Local visibility respects host
|
|
241
|
+
component/external-atom switches. A changed state draws a new frame without
|
|
242
|
+
requiring a complete scene rebuild.
|
|
243
|
+
|
|
244
|
+
See [the API contract](docs/partial-updates.md),
|
|
245
|
+
[the external-control example](examples/partial_updates.py), and
|
|
246
|
+
[changes since 0.2.3](RELEASE_NOTES_0.2.4.md).
|
|
247
|
+
|
|
248
|
+
## Transparency and opacity control (0.2.5)
|
|
249
|
+
|
|
250
|
+
Transparent faces and physical edges share a global back-to-front order computed
|
|
251
|
+
from depth over projected overlap. The default renderer draws directly into Qt's
|
|
252
|
+
MSAA framebuffer without depth peeling or whole-window supersampling. Opaque
|
|
253
|
+
atoms, bonds and faces write depth before transparent surfaces. The host supplies
|
|
254
|
+
planar convex faces without physical intersections or cyclic visibility. Shared
|
|
255
|
+
boundaries are supported; dense overlap can still produce quadratic graph memory.
|
|
256
|
+
|
|
257
|
+
External opacity updates reuse resident geometry:
|
|
258
|
+
|
|
259
|
+
```python
|
|
260
|
+
viewer.set_polyhedron_opacities({3: 0.35, 7: 1.0})
|
|
261
|
+
viewer.update_scene(atom_positions={17: (x, y, z)},
|
|
262
|
+
polyhedron_opacities={3: 0.5})
|
|
263
|
+
viewer.set_polyhedron_opacities({3: None})
|
|
264
|
+
values = viewer.get_polyhedron_opacities()
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Use original scene indices and GUI-thread calls. Zero hides an object; one makes
|
|
268
|
+
it opaque; None restores its default. Invalid packets are rejected atomically.
|
|
269
|
+
Fill/edges change together and explicit opacity fades contacts. A separate table
|
|
270
|
+
normally uploads four bytes per changed object. Positive fractional values are
|
|
271
|
+
stored in engraving, whose displayed fills remain opaque; zero hides the object.
|
|
272
|
+
See the [complete contract](docs/partial-updates.md).
|
|
273
|
+
|
|
274
|
+
## Optional WBOIT modes
|
|
275
|
+
|
|
276
|
+
**Shift + right mouse button** opens two independent checkboxes:
|
|
277
|
+
|
|
278
|
+
| Setting | Behavior |
|
|
279
|
+
| --- | --- |
|
|
280
|
+
| Weighted Blended OIT when rotate | Approximate during rotation, exact after release/external inactivity |
|
|
281
|
+
| Weighted Blended OIT always | Approximate also at rest and after mouse release; takes priority |
|
|
282
|
+
|
|
283
|
+
Both default to false, apply to one widget, are not saved to disk, and are
|
|
284
|
+
ignored by engraving. Ordinary right-button dragging still pans. The existing
|
|
285
|
+
external API controls both:
|
|
286
|
+
|
|
287
|
+
```python
|
|
288
|
+
viewer.set_display_options(weighted_blended_oit=True) # permanent
|
|
289
|
+
viewer.set_display_options(weighted_blended_oit=False) # leave permanent mode
|
|
290
|
+
viewer.set_display_options(weighted_blended_oit_when_rotate=True)
|
|
291
|
+
# Both off: use sorted transparency throughout.
|
|
292
|
+
viewer.set_display_options(weighted_blended_oit=False,
|
|
293
|
+
weighted_blended_oit_when_rotate=False)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
The checkboxes retain their independent values. Disabling permanent mode restores
|
|
297
|
+
the rotation-only preference. With rotation-only enabled, external set_orientation
|
|
298
|
+
series request an exact frame after 150 ms without an effective change. Repeating
|
|
299
|
+
the same orientation does not restart the timer. Mouse-held rotation stays fast
|
|
300
|
+
until release/interruption. Permanent mode does not start an idle-to-exact timer.
|
|
301
|
+
Neither quality changes nor timer completion emit extra orientation signals;
|
|
302
|
+
emit=False keeps its meaning. Pan/zoom alone do not start rotation-only WBOIT.
|
|
303
|
+
|
|
304
|
+
WBOIT uses two GL 3.3 accumulation passes and per-sample composition with shared
|
|
305
|
+
owned MSAA depth. It skips exact sorting and reuses resident meshes. Edge
|
|
306
|
+
coverage participates in alpha; opaque edges are handled separately and
|
|
307
|
+
contours/contacts are depth-tested beneath transparency. The approximation can
|
|
308
|
+
change hues/edge emphasis. Permanent mode intentionally retains it after stopping.
|
|
309
|
+
Small scenes may be slower with WBOIT enabled.
|
|
310
|
+
|
|
311
|
+
Resources are lazy and reused. Additional attachments cost approximately
|
|
312
|
+
20 bytes × physical width × physical height × actual samples: 23.4 MiB at
|
|
313
|
+
640 × 480 × 4, or 158.2 MiB at 1920 × 1080 × 4. DPR 2 multiplies this by four.
|
|
314
|
+
Qt/geometry/driver padding is additional. Exceeding the 256 MiB per-widget budget
|
|
315
|
+
or GPU limits uses exact fallback without silently lowering MSAA. Allocation or
|
|
316
|
+
pass failures appear in the menu and weighted_oit_error, separately from the
|
|
317
|
+
main opengl_error; retry is permitted after context restoration or close/show.
|
|
318
|
+
Scene clear/cleanup releases attachments. The historical
|
|
319
|
+
transparency_supersampling=1/2 field remains an inert compatibility option.
|
|
320
|
+
|
|
321
|
+
## Preparation and robustness (0.2.5)
|
|
322
|
+
|
|
323
|
+
World geometry, topology/material keys and normals are prepared once for camera
|
|
324
|
+
updates. Projected bounds prune sort candidates. Refittable spatial indices and
|
|
325
|
+
cached face frames reduce contact/local-update work. Opacity-only state is lazy;
|
|
326
|
+
host polyhedron style refreshes stay local. The legend uses cached visible
|
|
327
|
+
components. GPU ranges and derived geometry are validated, integer indices are
|
|
328
|
+
strict, unstable orientations are rejected atomically and huge finite occupancy
|
|
329
|
+
weights are normalized safely. Scene clear releases scene storage, shader-failure
|
|
330
|
+
cleanup is transactional, and ordinary close/show restores GPU resources.
|
|
331
|
+
|
|
332
|
+
See [release notes relative to GitHub 0.2.4](RELEASE_NOTES_0.2.5.md),
|
|
333
|
+
[transparency details](docs/hybrid-transparency.md),
|
|
334
|
+
[external-control example](examples/partial_updates.py), and
|
|
335
|
+
[validation commands](validation/README.md). Existing host calls/dependencies and
|
|
336
|
+
all 0.2.4 instancing/hatching features remain supported.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# unit-cell-gui
|
|
2
|
+
|
|
3
|
+
`unit-cell-gui` is a reusable PySide6 widget that draws complete unit-cell
|
|
4
|
+
scenes supplied by another program. It does not read CIF files, expand
|
|
5
|
+
symmetry, resolve atomic positions, infer bonds, construct polyhedra or
|
|
6
|
+
calculate diffraction.
|
|
7
|
+
|
|
8
|
+
The caller supplies ready Cartesian coordinates and presentation data:
|
|
9
|
+
|
|
10
|
+
- atoms and their styled occupancy components;
|
|
11
|
+
- bond indices;
|
|
12
|
+
- unit-cell vertices and edges;
|
|
13
|
+
- three basis vectors;
|
|
14
|
+
- optional polyhedron vertices, polygon faces and centres.
|
|
15
|
+
|
|
16
|
+
The package owns only display behaviour: camera projection, OpenGL depth buffering,
|
|
17
|
+
left-button rotation, right-button panning, wheel zoom, occupancy sectors,
|
|
18
|
+
colour and black-and-white drawing, and polyhedron hatching. Quadrilateral
|
|
19
|
+
hatching uses one intact polygon with `2x + 1` full parallel strokes. Hatch
|
|
20
|
+
directions on farther faces are refolded through real shared edges.
|
|
21
|
+
|
|
22
|
+
<table>
|
|
23
|
+
<tr>
|
|
24
|
+
<td align="center" width="50%">
|
|
25
|
+
<img src="https://raw.githubusercontent.com/ofussr/unit-cell-gui/main/docs/images/color-view.png" alt="Color view" width="100%">
|
|
26
|
+
<br>
|
|
27
|
+
<sub>Color view</sub>
|
|
28
|
+
</td>
|
|
29
|
+
<td align="center" width="50%">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/ofussr/unit-cell-gui/main/docs/images/hatched-view.png" alt="Hatched view" width="100%">
|
|
31
|
+
<br>
|
|
32
|
+
<sub>Hatched view</sub>
|
|
33
|
+
</td>
|
|
34
|
+
</tr>
|
|
35
|
+
</table>
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m pip install unit-cell-gui
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Python 3.10 or newer, NumPy, PySide6 Essentials and PyOpenGL are required. The renderer requests an OpenGL 3.3 core-profile context.
|
|
44
|
+
|
|
45
|
+
Import `UnitCellViewer` or `CrystalCanvas` before constructing `QApplication`.
|
|
46
|
+
This lets the package establish one shared OpenGL format for every viewer and
|
|
47
|
+
keeps top-level Qt composition stable across screen and DPI changes. The basic
|
|
48
|
+
example below already uses this order.
|
|
49
|
+
|
|
50
|
+
## Basic use
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import numpy as np
|
|
54
|
+
from PySide6.QtWidgets import QApplication
|
|
55
|
+
from unit_cell_gui import Atom, AtomComponent, DisplayOptions, Scene, UnitCellViewer
|
|
56
|
+
|
|
57
|
+
silicon = AtomComponent(
|
|
58
|
+
key="Si:Si1", label="Si1", element="Si",
|
|
59
|
+
occupancy=1.0, colour="#f0c8a0", radius=0.30,
|
|
60
|
+
)
|
|
61
|
+
scene = Scene(
|
|
62
|
+
atoms=(Atom("Si:Si1", "Si1", (silicon,)),),
|
|
63
|
+
atom_centers=np.array([[0.0, 0.0, 0.0]]),
|
|
64
|
+
bonds=np.empty((0, 2), dtype=int),
|
|
65
|
+
cell_vertices=np.array([
|
|
66
|
+
[x, y, z]
|
|
67
|
+
for x in (-1.0, 1.0)
|
|
68
|
+
for y in (-1.0, 1.0)
|
|
69
|
+
for z in (-1.0, 1.0)
|
|
70
|
+
]),
|
|
71
|
+
cell_edges=np.array([
|
|
72
|
+
[0, 1], [0, 2], [0, 4], [1, 3], [1, 5], [2, 3],
|
|
73
|
+
[2, 6], [3, 7], [4, 5], [4, 6], [5, 7], [6, 7],
|
|
74
|
+
]),
|
|
75
|
+
basis_vectors=np.eye(3),
|
|
76
|
+
base_radius=2.0,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
app = QApplication([])
|
|
80
|
+
viewer = UnitCellViewer()
|
|
81
|
+
viewer.set_scene(scene)
|
|
82
|
+
viewer.set_display_options(DisplayOptions(show_polyhedra=False))
|
|
83
|
+
viewer.show()
|
|
84
|
+
app.exec()
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`Scene` copies its arrays and makes them read-only. Later changes in the caller
|
|
88
|
+
therefore cannot alter an already submitted scene.
|
|
89
|
+
|
|
90
|
+
## Orientation synchronization
|
|
91
|
+
|
|
92
|
+
`orientation` is a 3 by 3 world-to-camera matrix. For column vectors the
|
|
93
|
+
camera coordinate is `orientation @ world`; the renderer's row arrays use the
|
|
94
|
+
equivalent `world @ orientation.T`.
|
|
95
|
+
|
|
96
|
+
Matrices must be finite and float32-representable, remain invertible after
|
|
97
|
+
float32 rounding, and have condition number below 1e6. Their inverse and
|
|
98
|
+
conservative generated/transformed geometry bounds must also fit float32.
|
|
99
|
+
Reflections and general well-conditioned invertible matrices remain accepted;
|
|
100
|
+
SO(3) orthogonality is not required. Invalid input leaves the previous state
|
|
101
|
+
unchanged and does not emit a signal.
|
|
102
|
+
|
|
103
|
+
Programmatic changes are silent by default:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
viewer.set_orientation(matrix, emit=False)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Interactive rotation emits the complete new matrix through
|
|
110
|
+
`orientation_changed`. Connect that signal to a pole figure or another view,
|
|
111
|
+
then send changes from the other view back with silent `set_orientation` calls.
|
|
112
|
+
This supports bidirectional synchronization without a signal loop.
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
viewer.orientation_changed.connect(update_other_view)
|
|
116
|
+
other_view.orientation_changed.connect(
|
|
117
|
+
lambda matrix: viewer.set_orientation(matrix, emit=False)
|
|
118
|
+
)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Set `rotation_enabled=False` when an application temporarily forbids left-button
|
|
122
|
+
rotation. Panning and zoom remain available. Polyhedra are hidden by default
|
|
123
|
+
and must be enabled with `show_polyhedra=True`.
|
|
124
|
+
|
|
125
|
+
Per-position colours, visibility and opaque-polyhedron selections are replaced
|
|
126
|
+
atomically with `viewer.set_style_overrides(StyleOverrides(...))`. The widget
|
|
127
|
+
copies these mappings, so the host can keep its own independent UI state.
|
|
128
|
+
|
|
129
|
+
## Atom instancing
|
|
130
|
+
|
|
131
|
+
Atoms share one indexed sphere mesh with the same 16-by-24 tessellation as
|
|
132
|
+
previous releases. An OpenGL instance buffer stores each visible atom's
|
|
133
|
+
Cartesian centre, radius, eight RGB occupancy colours and cumulative occupancy
|
|
134
|
+
thresholds once, instead of repeating them for every triangle vertex. The atom
|
|
135
|
+
layer uses one `glDrawElementsInstanced` call.
|
|
136
|
+
|
|
137
|
+
The base sphere and its indices occupy 18,792 bytes per viewer; instance records
|
|
138
|
+
add 144 bytes per visible atom. For 1,000 atoms, these buffers total 162,792
|
|
139
|
+
bytes, compared with 328,320,000 bytes for the previous expanded atom buffer.
|
|
140
|
+
This comparison excludes bonds, outlines, polyhedra and Qt/driver overhead.
|
|
141
|
+
The number of sphere triangles is unchanged, so this is primarily a reduction
|
|
142
|
+
in geometry preparation and buffer storage, not a frame-rate guarantee.
|
|
143
|
+
|
|
144
|
+
OpenGL 3.3 core remains sufficient: the renderer uses 13 vertex attribute
|
|
145
|
+
locations, within the guaranteed minimum of 16. No C++ extension, new package
|
|
146
|
+
dependency or host-application API change is required.
|
|
147
|
+
|
|
148
|
+
## Visibility and rendering caches
|
|
149
|
+
|
|
150
|
+
Both global and per-site polyhedron visibility filter already prepared geometry
|
|
151
|
+
at draw time. Faces, edges and atom/face intersection contours remain in GPU
|
|
152
|
+
buffers when a site is hidden or shown. This avoids rebuilding the full
|
|
153
|
+
polyhedron layer for each individual visibility change.
|
|
154
|
+
|
|
155
|
+
Engraving hatching is cached per polyhedron. Its density still follows the
|
|
156
|
+
depth range of the visible polyhedra: hiding the nearest or farthest object can
|
|
157
|
+
change other objects' effective division counts. Only affected hatch buffers
|
|
158
|
+
are updated. Rotation, zoom, panning and window-size changes keep the original
|
|
159
|
+
view-dependent hatching behaviour. CPU density variants are bounded and are
|
|
160
|
+
discarded when the view or scene changes.
|
|
161
|
+
|
|
162
|
+
Intersection contours and hatching are prepared when their layers are first
|
|
163
|
+
needed. The initial preparation still has a cost; subsequent site visibility
|
|
164
|
+
changes reuse the prepared data.
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
## Renderer compatibility
|
|
168
|
+
|
|
169
|
+
`UnitCellViewer` and the legacy alias `CrystalCanvas` now use the OpenGL
|
|
170
|
+
renderer internally. Existing construction, scene submission, display-option,
|
|
171
|
+
style-override, orientation-synchronization and interaction calls remain the
|
|
172
|
+
same. `OpenGLUnitCellViewer` remains available as an explicit name and refers
|
|
173
|
+
to the same renderer class.
|
|
174
|
+
|
|
175
|
+
## Used in
|
|
176
|
+
|
|
177
|
+
`unit-cell-gui` is used as the crystal-structure viewer in [XRD Combine](https://github.com/ofussr/XRD-Combine), where it is integrated with CIF processing, diffraction tools, and synchronized crystallographic views.
|
|
178
|
+
|
|
179
|
+
## How to cite
|
|
180
|
+
|
|
181
|
+
If you use `unit-cell-gui` in academic work, please cite the Zenodo record:
|
|
182
|
+
|
|
183
|
+
[](https://doi.org/10.5281/zenodo.22714946)
|
|
184
|
+
|
|
185
|
+
You can also use the metadata provided in [`CITATION.cff`](CITATION.cff).
|
|
186
|
+
|
|
187
|
+
## Shared GPU geometry (0.2.4)
|
|
188
|
+
|
|
189
|
+
Atoms, camera-facing outlines, coloured bonds, polyhedron fill triangles,
|
|
190
|
+
physical edges and engraving bonds use shared meshes and instance records.
|
|
191
|
+
Camera changes keep geometry resident; depth-sorted edges update compact
|
|
192
|
+
index lists. Large arrays are split at the driver's texture-buffer limit.
|
|
193
|
+
Sphere tessellation remains 720 triangles per atom; no LOD is applied.
|
|
194
|
+
|
|
195
|
+
Hatching uses intact polygons and the existing stroke algorithm. In coloured mode, atom/face
|
|
196
|
+
intersection curves use the corresponding face colour, including polyhedron
|
|
197
|
+
colour overrides. Engraving keeps black intersection ink.
|
|
198
|
+
|
|
199
|
+
## External partial updates (0.2.4)
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
viewer.update_scene(
|
|
203
|
+
atom_positions={17: (x, y, z)},
|
|
204
|
+
atom_visibility={42: False},
|
|
205
|
+
polyhedra={3: updated_polyhedron},
|
|
206
|
+
polyhedron_opacities={3: 0.35},
|
|
207
|
+
)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Original scene indices stay stable; positions are absolute Cartesian XYZ.
|
|
211
|
+
Packets are validated atomically, copied and uploaded on the next paint.
|
|
212
|
+
Only changed atoms, their existing adjacent bonds and affected polyhedra are
|
|
213
|
+
updated; dependent sections and hatching refresh as needed.
|
|
214
|
+
|
|
215
|
+
`set_atom_positions`, `set_atom_visibility` and `update_polyhedra` provide
|
|
216
|
+
individual setters. `reset_scene_updates()` restores input geometry and local
|
|
217
|
+
visibility while preserving camera and host styles. Effective-state getters
|
|
218
|
+
are `get_atom_positions()`, `get_atom_visibility()` and `get_polyhedra()`.
|
|
219
|
+
|
|
220
|
+
`viewer.scene` remains the original object; `set_scene()` clears the overrides.
|
|
221
|
+
Call updates on the GUI thread. The host supplies updated polyhedra and bond
|
|
222
|
+
topology; neither is inferred automatically. Local visibility respects host
|
|
223
|
+
component/external-atom switches. A changed state draws a new frame without
|
|
224
|
+
requiring a complete scene rebuild.
|
|
225
|
+
|
|
226
|
+
See [the API contract](docs/partial-updates.md),
|
|
227
|
+
[the external-control example](examples/partial_updates.py), and
|
|
228
|
+
[changes since 0.2.3](RELEASE_NOTES_0.2.4.md).
|
|
229
|
+
|
|
230
|
+
## Transparency and opacity control (0.2.5)
|
|
231
|
+
|
|
232
|
+
Transparent faces and physical edges share a global back-to-front order computed
|
|
233
|
+
from depth over projected overlap. The default renderer draws directly into Qt's
|
|
234
|
+
MSAA framebuffer without depth peeling or whole-window supersampling. Opaque
|
|
235
|
+
atoms, bonds and faces write depth before transparent surfaces. The host supplies
|
|
236
|
+
planar convex faces without physical intersections or cyclic visibility. Shared
|
|
237
|
+
boundaries are supported; dense overlap can still produce quadratic graph memory.
|
|
238
|
+
|
|
239
|
+
External opacity updates reuse resident geometry:
|
|
240
|
+
|
|
241
|
+
```python
|
|
242
|
+
viewer.set_polyhedron_opacities({3: 0.35, 7: 1.0})
|
|
243
|
+
viewer.update_scene(atom_positions={17: (x, y, z)},
|
|
244
|
+
polyhedron_opacities={3: 0.5})
|
|
245
|
+
viewer.set_polyhedron_opacities({3: None})
|
|
246
|
+
values = viewer.get_polyhedron_opacities()
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Use original scene indices and GUI-thread calls. Zero hides an object; one makes
|
|
250
|
+
it opaque; None restores its default. Invalid packets are rejected atomically.
|
|
251
|
+
Fill/edges change together and explicit opacity fades contacts. A separate table
|
|
252
|
+
normally uploads four bytes per changed object. Positive fractional values are
|
|
253
|
+
stored in engraving, whose displayed fills remain opaque; zero hides the object.
|
|
254
|
+
See the [complete contract](docs/partial-updates.md).
|
|
255
|
+
|
|
256
|
+
## Optional WBOIT modes
|
|
257
|
+
|
|
258
|
+
**Shift + right mouse button** opens two independent checkboxes:
|
|
259
|
+
|
|
260
|
+
| Setting | Behavior |
|
|
261
|
+
| --- | --- |
|
|
262
|
+
| Weighted Blended OIT when rotate | Approximate during rotation, exact after release/external inactivity |
|
|
263
|
+
| Weighted Blended OIT always | Approximate also at rest and after mouse release; takes priority |
|
|
264
|
+
|
|
265
|
+
Both default to false, apply to one widget, are not saved to disk, and are
|
|
266
|
+
ignored by engraving. Ordinary right-button dragging still pans. The existing
|
|
267
|
+
external API controls both:
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
viewer.set_display_options(weighted_blended_oit=True) # permanent
|
|
271
|
+
viewer.set_display_options(weighted_blended_oit=False) # leave permanent mode
|
|
272
|
+
viewer.set_display_options(weighted_blended_oit_when_rotate=True)
|
|
273
|
+
# Both off: use sorted transparency throughout.
|
|
274
|
+
viewer.set_display_options(weighted_blended_oit=False,
|
|
275
|
+
weighted_blended_oit_when_rotate=False)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
The checkboxes retain their independent values. Disabling permanent mode restores
|
|
279
|
+
the rotation-only preference. With rotation-only enabled, external set_orientation
|
|
280
|
+
series request an exact frame after 150 ms without an effective change. Repeating
|
|
281
|
+
the same orientation does not restart the timer. Mouse-held rotation stays fast
|
|
282
|
+
until release/interruption. Permanent mode does not start an idle-to-exact timer.
|
|
283
|
+
Neither quality changes nor timer completion emit extra orientation signals;
|
|
284
|
+
emit=False keeps its meaning. Pan/zoom alone do not start rotation-only WBOIT.
|
|
285
|
+
|
|
286
|
+
WBOIT uses two GL 3.3 accumulation passes and per-sample composition with shared
|
|
287
|
+
owned MSAA depth. It skips exact sorting and reuses resident meshes. Edge
|
|
288
|
+
coverage participates in alpha; opaque edges are handled separately and
|
|
289
|
+
contours/contacts are depth-tested beneath transparency. The approximation can
|
|
290
|
+
change hues/edge emphasis. Permanent mode intentionally retains it after stopping.
|
|
291
|
+
Small scenes may be slower with WBOIT enabled.
|
|
292
|
+
|
|
293
|
+
Resources are lazy and reused. Additional attachments cost approximately
|
|
294
|
+
20 bytes × physical width × physical height × actual samples: 23.4 MiB at
|
|
295
|
+
640 × 480 × 4, or 158.2 MiB at 1920 × 1080 × 4. DPR 2 multiplies this by four.
|
|
296
|
+
Qt/geometry/driver padding is additional. Exceeding the 256 MiB per-widget budget
|
|
297
|
+
or GPU limits uses exact fallback without silently lowering MSAA. Allocation or
|
|
298
|
+
pass failures appear in the menu and weighted_oit_error, separately from the
|
|
299
|
+
main opengl_error; retry is permitted after context restoration or close/show.
|
|
300
|
+
Scene clear/cleanup releases attachments. The historical
|
|
301
|
+
transparency_supersampling=1/2 field remains an inert compatibility option.
|
|
302
|
+
|
|
303
|
+
## Preparation and robustness (0.2.5)
|
|
304
|
+
|
|
305
|
+
World geometry, topology/material keys and normals are prepared once for camera
|
|
306
|
+
updates. Projected bounds prune sort candidates. Refittable spatial indices and
|
|
307
|
+
cached face frames reduce contact/local-update work. Opacity-only state is lazy;
|
|
308
|
+
host polyhedron style refreshes stay local. The legend uses cached visible
|
|
309
|
+
components. GPU ranges and derived geometry are validated, integer indices are
|
|
310
|
+
strict, unstable orientations are rejected atomically and huge finite occupancy
|
|
311
|
+
weights are normalized safely. Scene clear releases scene storage, shader-failure
|
|
312
|
+
cleanup is transactional, and ordinary close/show restores GPU resources.
|
|
313
|
+
|
|
314
|
+
See [release notes relative to GitHub 0.2.4](RELEASE_NOTES_0.2.5.md),
|
|
315
|
+
[transparency details](docs/hybrid-transparency.md),
|
|
316
|
+
[external-control example](examples/partial_updates.py), and
|
|
317
|
+
[validation commands](validation/README.md). Existing host calls/dependencies and
|
|
318
|
+
all 0.2.4 instancing/hatching features remain supported.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# unit-cell-gui 0.2.4
|
|
2
|
+
|
|
3
|
+
Changes relative to 0.2.3. This release extends shared GPU geometry to atom
|
|
4
|
+
outlines, bonds and polyhedra, adds external partial scene updates, and fixes
|
|
5
|
+
the dark contact curves between coloured atoms and polyhedron faces.
|
|
6
|
+
Existing host applications can keep using their current integration code.
|
|
7
|
+
|
|
8
|
+
## Rendering and contact colours
|
|
9
|
+
|
|
10
|
+
- Atom silhouettes use one shared camera-facing 64-segment ring and compact
|
|
11
|
+
instance records. Rotation and zoom update uniforms instead of rebuilding
|
|
12
|
+
contour vertices on the CPU. Partial occupancy in engraving mode keeps
|
|
13
|
+
the original dashed contours.
|
|
14
|
+
- Coloured bonds use one shared 12-segment cylinder, with two instance records
|
|
15
|
+
per bond. Endpoint colours, midpoint joins, lighting and thickness are retained.
|
|
16
|
+
- Polyhedron fill triangles, physical edges and engraving bonds use shared
|
|
17
|
+
primitives with resident instance records. Transparency order is preserved;
|
|
18
|
+
depth-sorted edges use compact index lists. Large texture-buffer arrays are
|
|
19
|
+
split according to the actual driver's storage limit.
|
|
20
|
+
- Atom/face intersection curves now use the corresponding face's colour in
|
|
21
|
+
coloured mode, including host polyhedron colour overrides. They no longer
|
|
22
|
+
produce artificial black seams at contacts. Engraving mode retains black
|
|
23
|
+
intersection ink. Colours refresh correctly after mode/style changes and
|
|
24
|
+
partial polyhedron replacement.
|
|
25
|
+
- Atom tessellation remains 720 triangles per sphere. Line widths, depth
|
|
26
|
+
offsets, antialiasing, occupancy sectors and the intact-polygon hatching
|
|
27
|
+
algorithm are retained. This release does not add sphere LOD.
|
|
28
|
+
|
|
29
|
+
## External partial updates
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
viewer.update_scene(
|
|
33
|
+
atom_positions={17: (x, y, z)},
|
|
34
|
+
atom_visibility={42: False},
|
|
35
|
+
polyhedra={3: updated_polyhedron},
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Indices refer to the original Scene arrays; positions are absolute Cartesian
|
|
40
|
+
coordinates. Packets are validated atomically, copied and merged before the
|
|
41
|
+
next paint. Only supplied indices change. Call these methods on the GUI thread.
|
|
42
|
+
|
|
43
|
+
The individual setters are `set_atom_positions`, `set_atom_visibility` and
|
|
44
|
+
`update_polyhedra`. `reset_scene_updates()` restores the original geometry
|
|
45
|
+
and removes local hiding. `get_atom_positions()`, `get_atom_visibility()` and
|
|
46
|
+
`get_polyhedra()` return independent copies of the effective render state.
|
|
47
|
+
|
|
48
|
+
- Atom movement updates only its sphere/outline records and existing adjacent
|
|
49
|
+
bonds. Hiding also hides attached bonds and intersection curves.
|
|
50
|
+
- Replaced polyhedra have independent fill/edge buffers. Topology changes
|
|
51
|
+
resize only that object's storage. Dependent intersections and hatch caches
|
|
52
|
+
refresh as needed; other resident geometry is reused.
|
|
53
|
+
- The original `viewer.scene` remains unchanged. Camera, zoom, pan and host
|
|
54
|
+
style restrictions are preserved. `set_scene()` clears partial overrides.
|
|
55
|
+
- The host remains responsible for bond topology and updated polyhedra; these
|
|
56
|
+
are not inferred automatically. Every accepted change requests a new frame,
|
|
57
|
+
without requiring a complete scene rebuild.
|
|
58
|
+
|
|
59
|
+
See [the API contract](docs/partial-updates.md) and
|
|
60
|
+
[the external-control example](examples/partial_updates.py).
|
|
61
|
+
|
|
62
|
+
## Compatibility
|
|
63
|
+
|
|
64
|
+
Existing viewer aliases, Scene/Atom/Polyhedron models, method signatures,
|
|
65
|
+
signals and dependencies are retained. New methods are additive. OpenGL 3.3
|
|
66
|
+
core and GLSL 330 remain sufficient; no native extension is introduced.
|
|
67
|
+
GPU resources are cleaned up on scene/context teardown and reconstructed
|
|
68
|
+
after context recreation, including partial render state.
|
|
69
|
+
|
|
70
|
+
## Validation
|
|
71
|
+
|
|
72
|
+
The source and installed wheel are checked with real Mesa software OpenGL,
|
|
73
|
+
including colour/BW mode changes, contact colour overrides, partial updates,
|
|
74
|
+
full-scene reference images, transparency, buffer limits and context cleanup.
|
|
75
|
+
Detailed results are supplied in `VALIDATION_0.2.4.md` in the release archive.
|
|
76
|
+
Windows and hardware GPU drivers are not tested in this environment; rendering
|
|
77
|
+
speed depends on the scene and driver.
|