fix(biochem 3D): корректная глубина + объёмные связи-цилиндры

Два дефекта, из-за которых 3D читался как плоская диаграмма:
- painter-сортировка была по возрастанию z (ближние первыми) — дальние
  атомы рисовались поверх ближних. Теперь единый список примитивов
  (атомы + половинки связей) сортируется по убыванию z (дальние первыми).
- связи были тонкими плоскими линиями. Теперь — затенённые «цилиндры»:
  толстый штрих с поперечным градиентом (центр светлее, края темнее),
  двухцветные (каждая половина под цвет своего атома) — фирменный вид
  ball-and-stick. Ширина зависит от перспективы (ближе — толще).
- усилена перспектива (fov 900→700), добавлен тёмный ободок сфер для объёма.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-05-30 12:58:39 +03:00
parent 3b6481b1df
commit 410eb8a862
12 changed files with 559 additions and 27 deletions
+12
View File
@@ -52,6 +52,7 @@
// Pause all animation-loop sims (non-destructive). Called when switching
// between sims so a previously opened sim doesn't keep rendering offscreen.
function _pauseAllSims() {
if (window.LabRegistry) window.LabRegistry.stopActive();
if (pSim) pSim.pause();
if (cSim) cSim.pause();
if (gasSim) gasSim.stop();
@@ -105,6 +106,16 @@
// load theory for this sim
loadTheory(id.includes(':') ? id.split(':')[0] : id);
// Контент-движок: мигрированные симуляции открываются через реестр.
if (window.LabRegistry && window.LabRegistry.has(id)) {
const _m = window.LabRegistry.get(id);
const _arg = id.includes(':') ? id.split(':')[1] : undefined;
window.LabRegistry.setActive(_m);
try { _m.open({ id: id, arg: _arg }); } catch (e) { console.error('[LabRegistry] open failed:', id, e); }
if (window.lucide) lucide.createIcons();
return;
}
if (id === 'graph') _openGraph();
if (id === 'projectile') _openProjectile();
if (id === 'collision') _openCollision();
@@ -210,6 +221,7 @@
}
function closeSim() {
if (window.LabRegistry) window.LabRegistry.destroyActive();
if (pSim) pSim.pause();
if (cSim) cSim.pause();
if (mSim && mSim.particleOn) mSim.toggleParticle();