[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92248":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":12,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":15,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":16,"hasPages":18,"topics":19,"createdAt":8,"pushedAt":8,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":13,"starSnapshotCount":13,"syncStatus":11,"lastSyncTime":23,"discoverSource":24},92248,"molar_vis","yesint\u002Fmolar_vis","yesint",null,"Rust",53,2,1,0,38.53,"Artistic License 2.0",false,"main",true,[],"2026-07-22 04:02:05","# molar_vis — a modern molecular viewer in pure Rust\n\n[![Rust](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frust-1.83+-blue.svg)](https:\u002F\u002Fwww.rust-lang.org\u002F)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Artistic--2.0-blue.svg)](#license)\n[![Built on molar](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fbuilt%20on-molar-orange.svg)](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar)\n[![Platforms](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatforms-Linux%20%7C%20Windows%20%7C%20macOS%20%7C%20WASM-green.svg)](#building)\n\nA modern, **legacy-free** molecular visualizer modeled after [VMD](https:\u002F\u002Fwww.ks.uiuc.edu\u002FResearch\u002Fvmd\u002F),\nwritten in **pure Rust**. The molecule is drawn with hand-written **GPU ray-cast\nimpostors** (WGSL) and real-time cartoon ribbons — no OpenGL fixed pipeline, no X11,\nno C\u002FC++\u002FTcl. It runs natively on Linux, Windows, macOS and compiles to WebAssembly\n([try it now online](https:\u002F\u002Fyesint.github.io\u002Fmolar_vis\u002F)).\n\nThe binary is called `molar_vis`. It is built on [molar](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar)\n— a Rust molecular-analysis library by the same author — for file I\u002FO, atom selections,\ntopology and secondary-structure assignment, and renders on\n[`eframe`\u002F`egui`](https:\u002F\u002Fgithub.com\u002Femilk\u002Fegui) + [`wgpu`](https:\u002F\u002Fgithub.com\u002Fgfx-rs\u002Fwgpu).\n\nBeyond the basics it leans into the **niceties that make a viewer pleasant to live in**:\nscreen-space **ambient occlusion** and real-time **cast shadows**, VMD-style **depth cueing**,\n**order-independent transparency**, **gradient backgrounds**, a material picker with **live\npreviews**, periodic-image replication with dashed wrap-around bonds, and a **hover lens** that\nquietly reveals the atoms tucked under a cartoon ribbon or a molecular surface. A settings dialog\nremembers how you like things between runs.\n\n![molar_vis](docs\u002Fscreenshot.png)\n\n## Why another molecular viewer?\n\nVMD is the gold standard for molecular visualization, but it carries three decades\nof accumulated legacy: a C\u002FC++ core glued together with Tcl, an OpenGL fixed-function\nrendering path, and a build that fights modern toolchains and platforms. `molar_vis`\nis a clean-room reimagining of the *good parts* of VMD on a modern foundation:\n\n- **Pure Rust, end to end** — memory-safe, no segfaults, no manual memory management,\n  one `cargo build`.\n- **A modern GPU pipeline** — atoms and bonds are ray-cast as analytic impostors in\n  fragment shaders that write true depth, so they occlude perfectly and stay crisp at\n  any zoom; cartoon ribbons are a real triangle mesh that interleaves with them. No\n  fixed-function OpenGL, no immediate mode.\n- **Portable by construction** — `wgpu` targets Vulkan, Metal, DX12 and WebGPU, so the\n  same code runs on the desktop and in a browser.\n- **VMD muscle memory preserved** — the same selection language, the same mouse\n  navigation, the same representations and coloring schemes.\n\nIt is deliberately small and focused: a fast, beautiful, hackable viewer, not a\nreimplementation of every VMD feature.\n\n## Features\n\n**Representations** — six styles, all GPU-accelerated:\n\n| Style | Rendering | Notes |\n|---|---|---|\n| **Lines** | 1‑px GL lines | the lightweight default, VMD-authentic |\n| **Licorice** | cylinder + sphere impostors | uniform bond radius |\n| **Ball and Stick** | sphere + cylinder impostors | scaled VDW balls + thin sticks |\n| **VDW** | sphere impostors | space-filling, true van der Waals radii |\n| **Cartoon** | indexed triangle mesh | secondary-structure ribbons (see below) |\n| **Surface** | grid + Surface Nets mesh | solvent-excluded (rolling-probe) surface (see below) |\n\n**Cartoon ribbons** — a faithful port of VMD's *NewCartoon*: a per-chain\nmodified Catmull–Rom spline through the Cα trace, a carbonyl-derived ribbon frame with\nrunning-average orientation, elliptical cross-sections that morph by secondary-structure\nclass, and β-strand arrowheads. Secondary structure is assigned by molar's built-in\n**DSSP** (Kabsch–Sander) or **`dss`** (a clean-room port of PyMOL's algorithm),\nselectable per representation.\n\n**Molecular surface** — the **solvent-excluded (rolling-probe) surface**, computed the\nrobust way modern tools (PyMOL\u002FChimera\u002FEDTSurf) use: a distance field on a grid (the SAS\nsolid, then a Felzenszwalb–Huttenlocher distance transform carving the probe) is contoured\nwith **Surface Nets** for a watertight, smooth mesh — no fragile analytic patch stitching.\nPer-rep **probe radius**, **grid resolution** and **smoothing** controls; scales to 100k+\natoms. (molar's PowerSASA backend also exposes exact SASA areas + analytic SAS\u002FSES meshes.)\n\n**Materials** — eleven VMD-style presets (Opaque, Transparent, Glass, Translucent, Ghost,\nGlossy, Diffuse, Metal, and the ambient-occlusion trio AOChalky \u002F AOShiny \u002F AOEdgy): per-rep\nambient \u002F diffuse \u002F specular \u002F shininess (Blinn-Phong) plus **opacity** and a silhouette\n**outline** (AOEdgy), with **order-independent transparency** (weighted-blended OIT) so\noverlapping translucent surfaces blend correctly without sorting. The material picker isn't a\nplain list — it's a **grid of live previews**, each a little shaded molecule rendered with that\nmaterial, so Glossy, Metal, Glass and the matte AO presets read at a glance.\n\n**Trajectories** (native) — load multi-frame trajectories (xtc\u002Ftrr\u002Fdcd\u002Fgro\u002Fmulti-MODEL pdb)\ninto a molecule with a VMD-style playback bar (first \u002F step \u002F play-pause \u002F step \u002F last,\neditable frame field, loop, fps) and a frame slider; sync or background-async loading.\nFrame changes are zero-copy (rendered by reference) with incremental GPU updates. Per-representation\n**trajectory smoothing** (Savitzky–Golay) damps thermal jitter on the fly, and loaded frames can be\ntrimmed or decimated.\n\n**Coloring schemes** — Element (CPK), Chain, ResID, ResName, Index, B-factor,\nSecondary structure, and **Solid** (a custom color you pick), each with a drawn descriptive\nicon in the picker.\n\n**Selections** — molar's VMD\u002FPteros-style selection language: `protein`, `backbone`,\n`water`, `name CA`, `resid 1:50`, `chain A`, `within 5.0 of ...`, and much more.\nSelections are compiled once and re-evaluated only when needed. The selection field helps you as\nyou type: it **paints the erroring span of an invalid selection red, in place**, and shows a hint\nof the **available chains, residue names and id\u002Findex ranges** for the keyword you're on.\n\n**Picking, lasso & the hover lens** — flip the top-bar **Sel. mode** to explore atoms with the mouse:\n\n- **Hover** — point at an atom for its identity and *real* coordinates with a glowing outline ring\n  (or a whole-residue highlight in *Residues* scope). Native picking uses a GPU id-buffer, so it\n  stays instant on huge systems.\n- **Lasso** — draw a freehand loop to grab atoms (Shift adds, Ctrl subtracts). The catch is staged\n  as a *pending* selection that **glows in each representation's own style** — lasso a helix shown as\n  cartoon and the **ribbon itself** lights up, not dots over it — with a one-click accept\u002Fdiscard. A\n  **scope** dropdown grows every pick to whole **Residues** or heavy-atoms-plus-their-**H**.\n\n…and the star of the show, the **hover detail lens**: hover over a cartoon ribbon or a molecular\nsurface and the atoms hiding *underneath* — the chemistry those styles abstract away — fade into view\nas a small CPK ball-and-stick \"lens\" that tracks your cursor down the line of sight. It reveals the\ncamera-facing residues right where you're looking (not just the single nearest atom, so it works in\nribbon gaps and surface dimples too) and dissolves softly back in as you move on — so you can read the\nunderlying structure without ever switching representation.\n\n**Rendering options** — collected in the **view-settings menu** (the hamburger on the right of\nthe top bar, with **Camera \u002F Lighting \u002F Scene** tabs):\n- **Projection** — perspective or orthographic (orthographic is the default).\n- **Depth cueing** (fog) — fades distant geometry toward the background, with three VMD-style\n  falloff curves: **Linear**, **Exp**, **Exp²** (plus *None*), and Strength \u002F Start controls.\n- **Ambient occlusion** (SSAO) — a screen-space pass that darkens creases and contact points.\n- **Cast shadows** — real-time directional shadows from a key light (shadow mapping), applied\n  deferred so they cost one extra geometry pass.\n- **Background** — a flat color or a vertical **gradient** (top \u002F bottom color pickers).\n- **Orientation axes** gizmo (VMD-style), in any viewport corner.\n- **Anti-aliasing** — supersampling (configurable 1–4×, default 2×; smooths the ray-cast impostor\n  silhouettes that MSAA can't touch), with idle frames costing **zero GPU**.\n\n**Camera & display**\n- Quaternion arcball camera with VMD mouse mapping (rotate \u002F roll \u002F pan \u002F dolly \u002F zoom-to-cursor).\n- Zoom-to-selection and zoom-to-molecule; per-molecule periodic-box wireframe.\n- **Periodic images** — replicate any representation across ±a\u002F±b\u002F±c lattice cells (drawn *by\n  reference*, no data duplicated), with the box wireframe. Enable **periodic bond search** (a\n  setting; off by default since it's slower on large structures) and covalent bonds that wrap across\n  a box face are found and drawn as **dashed minimum-image half-bonds**, with cartoon ribbons\n  splitting cleanly at the boundary rather than streaking across the cell.\n\n**Scene**\n- Multiple molecules, each with multiple representations.\n- Per-representation selection, style, color and material, with a tabbed settings panel\n  (**Style** \u002F **Traj** \u002F **Periodic**) for per-rep tunables.\n- Drag-to-reorder representations; duplicate; show\u002Fhide.\n- Full **undo\u002Fredo** with named history (Ctrl+Z \u002F Ctrl+Shift+Z \u002F Ctrl+Y).\n\n**Settings, sessions & files**\n- **Program settings** — a cogwheel in the toolbar opens a tabbed window\n  (*Appearance \u002F Rendering \u002F View \u002F Representations \u002F Behavior*) for everything that used to be baked\n  in at launch: UI theme + font scale + accent color, anti-aliasing and shadow-map quality, the\n  default projection \u002F background \u002F lighting \u002F representation \u002F coloring for *new* scenes, mouse\n  sensitivity, trajectory playback defaults, and bond detection (thresholds, **periodic search**,\n  and the dashed wrap-around-bond toggle). App-wide tweaks (theme,\n  anti-aliasing) apply live; the rest seed the next scene you open. Everything **persists to a JSON\n  file** in your platform's config directory, written with sensible defaults on first launch.\n- **Sessions** — save and reload the whole visualization state (molecules by source path, every\n  representation, the camera and all view settings) as a single JSON session.\n- **Export** (native) — write a molecule, or just one representation's selection, back out to\n  PDB \u002F GRO \u002F XYZ at the displayed frame.\n\n**Efficient by default** — the scene is only re-rendered when geometry, the camera, the\nviewport size or visibility actually change. **Idle costs zero GPU**; the UI repaints on\ninput. The impostor pipeline scales to hundreds of thousands of atoms.\n\n## Building\n\nWith a [Rust toolchain](https:\u002F\u002Frustup.rs) installed — `molar` and its `powersasa`\ndependency are pulled directly from GitHub, so no sibling checkouts are needed:\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar_vis\ncd molar_vis\ncargo build --release\n```\n\nRun it, passing one or more structure files (each file becomes one molecule):\n\n```sh\ncargo run --release -p molar_vis -- protein.pdb            # one molecule\ncargo run --release -p molar_vis -- system.gro ligand.pdb  # two molecules\n```\n\nSupported input formats are whatever molar reads — including **PDB**, **GRO**, and\n(with the appropriate molar features) trajectory and topology formats.\n\n### WebAssembly — run it in the browser\n\nThe viewer also runs in the browser (single-threaded WebAssembly, WebGPU with an\nautomatic **WebGL2 fallback**). **Try the live demo: \u003Chttps:\u002F\u002Fyesint.github.io\u002Fmolar_vis\u002F>**\n— it opens to a sample structure; use **Open** to load your own `.pdb`\u002F`.gro`\u002F`.xyz`.\n\nBuild and serve it locally with [Trunk](https:\u002F\u002Ftrunkrs.dev):\n\n```sh\ncargo install --locked trunk     # once\ncd crates\u002Fmolar_vis_web\ntrunk serve                      # then open the printed http:\u002F\u002F127.0.0.1:8080\n```\n\nThe browser crate (`crates\u002Fmolar_vis_web`) renders through `eframe`'s `WebRunner` and\nreads files in memory via molar's `FileHandler::from_reader` — no server needed, so it\nhosts on any static site. It's deployed to GitHub Pages from `.github\u002Fworkflows\u002Fpages.yml`\non every push to `main`. molar's parallelism (rayon) runs serially on wasm; trajectories load too —\nthe picked file's frames stream into the viewer incrementally (no threads). File **export** and the\non-disk **settings\u002Fsession** files are native-only (the browser has no filesystem).\n\n### Python module\n\n`molar_vis` also builds as a **native Python module** (see\n[Scripting it from Python](#scripting-it-from-python)). Build and install it with\n[maturin](https:\u002F\u002Fwww.maturin.rs), which installs into the **active** virtualenv \u002F\nconda environment:\n\n```sh\n# from the repo root\npython3 -m venv .venv && source .venv\u002Fbin\u002Factivate    # maturin needs an active env\npip install maturin numpy                             # numpy: used by sel.translate(), etc.\n\ncd crates\u002Fmolar_vis_py\nmaturin develop --release        # build the extension + install it as `molar_vis`\ncd ..\u002F..\n```\n\nA Rust toolchain is required (maturin invokes `cargo`). Re-run `maturin develop` after\npulling code changes.\n\n> **Python 3.14+:** pyo3 0.27 is tested up to CPython 3.13, so on a newer interpreter\n> prefix the build with `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1` (e.g.\n> `PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 maturin develop --release`).\n\nThe module **re-exports [pymolar](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar)** (molar's Python\nbindings), so a single `import molar_vis` gives you both molar's full analysis API *and*\nthe viewer, with one consistent set of types. Native only — a GPU\u002Fwindowing extension\ncan't target the browser (use the [WebAssembly build](#webassembly--run-it-in-the-browser)\nthere). The viewer window runs on a background thread, which works on **Linux and\nWindows**; macOS (which requires the GUI on the main thread) isn't wired up yet.\n\n## Scripting it from Python\n\nBeyond the GUI, you can drive `molar_vis` from a **Python script or a Jupyter \u002F IPython\nnotebook**: build molecules and selections with molar's full (numpy-backed) analysis API,\nopen a live viewer window, and keep working — the window runs on its own thread, so the\nREPL never blocks, and it renders **directly from your pymolar objects** (zero-copy), so\nedits show up without an explicit refresh.\n\n```python\nimport molar_vis as mv\n\ns   = mv.System(\"protein.pdb\")      # a pymolar System — full analysis API (numpy)\nsel = s(\"name CA\")                  # a pymolar selection\n\nvis = mv.spawn()                    # open the viewer; returns immediately\nmol = vis.add_mol(s)                # render s — shared, no coordinates are copied\nrep = mol.add_rep(sel, style=\"cartoon\", color=\"ss\")\n\nsel.translate([1.0, 0.0, 0.0])      # move atoms in Python → the view updates live\n\nfor rep in vis.mols[0].reps:        # introspect the scene…\n    rep.style = \"lines\"             # …property setters apply live\n```\n\n**Running it.** Activate the venv you built into, and run **from the repo root** so\nrelative paths like `tests\u002F2lao.pdb` resolve. Interactively — IPython, Jupyter, or\n`python -i` — the window stays open and updates as you type. In a plain\n`python script.py` the process exits at the end and the window closes with it, so keep\nit alive:\n\n```python\nimport molar_vis as mv\ns = mv.System(\"tests\u002F2lao.pdb\")\nvis = mv.spawn(); mol = vis.add_mol(s)\nmol.add_rep(s(\"protein\"), style=\"cartoon\", color=\"ss\")\ninput(\"viewer open — press Enter to quit\\n\")   # or a loop \u002F time.sleep(...)\n```\n\nBecause the viewer shares the molecule's memory with Python, anything you do to it —\ntranslate, superpose, edit coordinates, step a trajectory — is reflected on screen with\nno copy and no manual redraw. The same objects carry molar's analysis API (RMSD, SASA,\nDSSP, geometric selections, …), so you analyze and visualize in one session.\n\n**API at a glance**\n\n| Call | Effect |\n|---|---|\n| `mv.System(path)`, `s(\"protein\")`, `rmsd(a, b)`, … | the re-exported **pymolar** API (analysis) |\n| `mv.spawn() -> Visualizer` | open a viewer window (non-blocking) |\n| `vis.add_mol(system) -> MolHandle` | render a molecule, zero-copy |\n| `vis.mols` | the molecules in the scene, as handles |\n| `mol.add_rep(sel=None, style=…, color=…, material=…) -> RepHandle` | add a representation |\n| `mol.reps` | that molecule's representations, as handles |\n| `rep.style = …` · `rep.color = …` · `rep.material = …` | live property setters |\n| `rep.select(sel)` | set a representation's selection from a pymolar `Sel` |\n\n`style`, `color` and `material` take the same names as the GUI pickers — e.g. `\"vdw\"`,\n`\"licorice\"`, `\"ballstick\"`, `\"cartoon\"`, `\"surface\"`; `\"element\"`, `\"chain\"`, `\"resid\"`,\n`\"ss\"`; `\"Opaque\"`, `\"Transparent\"`, `\"Glossy\"`, `\"Glass\"`, …\n\n**View & camera** — everything in the view-settings menu is scriptable on the\n`Visualizer`; all apply live:\n\n```python\nvis.rotate(yaw, pitch)            # orbit, degrees   ·  vis.roll(angle)\nvis.pan(dx, dy)                   # fraction of the viewport (+x right, +y up)\nvis.zoom(1.5)                     # >1 closer, \u003C1 farther\nvis.reset_view()                  # re-frame all molecules (zoom-to-fit)\n\nvis.projection(\"orthographic\")   # or \"perspective\"\nvis.background(0.0, 0.0, 0.05)   # solid RGB (0–1)\nvis.background_gradient((0.1, 0.12, 0.3), (0.0, 0.0, 0.0))   # top, bottom\n\nvis.axes(True, corner=\"top_left\")            # orientation gizmo; corner optional\nvis.depth_cue(mode=\"exp2\", strength=0.6, start=0.3)   # or mode=\"none\" to disable\nvis.ambient_occlusion(True, strength=0.9, radius=0.4)\nvis.shadows(True, strength=0.6)\n```\n\n> **Note.** Live updates are change-detected via a coordinate version counter on the\n> shared state, so a *static* molecule costs nothing — the viewer only re-renders when\n> you actually move atoms. The window runs on a background thread (Linux \u002F Windows;\n> macOS support is pending).\n\n## Selections\n\n`molar_vis` uses molar's selection language directly. A few examples:\n\n```\nall\nprotein and not hydrogen\nbackbone and chain A\nresid 1:50 and name CA\nresname ALA GLY\nwater\nwithin 5.0 of (resname LIG)\n```\n\nSee the [molar selection-syntax reference](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar#selection-syntax)\nfor the full grammar (keywords, comparisons, geometric and distance-based selections,\nlogical operators, `same ... as`, PBC options, …).\n\n## Navigation\n\nStandard VMD-style mouse mapping inside the 3D viewport:\n\n| Action | Mouse |\n|---|---|\n| Rotate (arcball) | left-drag |\n| Roll (screen-plane) | Shift + left-drag |\n| Pan | right-drag (or middle-drag) |\n| Dolly (move along view axis) | Shift + right-drag |\n| Zoom (toward the cursor) | scroll wheel |\n\n## How it works\n\nA few design points worth knowing if you want to hack on it:\n\n- **\"Strategy A\" rendering.** The 3D scene is drawn into our *own* offscreen color +\n  `Depth32Float` textures and then composited into the egui frame as an image. egui's own\n  render pass has no depth attachment, so owning the targets is what gives us full depth\n  control — required for the impostors.\n- **Impostors.** Spheres and cylinders are camera-facing billboards; the fragment shader\n  ray-casts the analytic surface and writes `frag_depth`, so geometry occludes correctly\n  (against itself *and* the cartoon mesh) and never tessellates. Both perspective\n  (eye-ray) and orthographic (parallel-ray) cameras are handled in the shader.\n- **Depth cueing** is applied in every fragment shader from a shared camera uniform,\n  fading geometry toward the background color by eye-space distance.\n- **A dirty-flag scene graph.** N molecules × M representations; each rep owns a compiled\n  selection and its GPU buffers. Selection recompilation and geometry rebuilds are driven\n  by per-rep dirty flags, and the whole frame is skipped when nothing changed.\n- **Units.** All geometry is in nanometers (molar's native unit) end to end.\n\nThe workspace is two crates: `molar_vis_core` (the WASM-safe library — all logic and\nrendering) and `molar_vis` (the thin native binary: argv + logging).\n\n## Status\n\n**Works today (native on Linux\u002FWindows\u002FmacOS, and in the browser):**\n- Load one or more molecules; multi-molecule \u002F multi-representation scenes.\n- All six representations (Lines, Licorice, Ball-and-Stick, VDW, Cartoon, Surface).\n- Every coloring scheme (incl. custom solid colors); the full molar selection language with\n  in-field error highlighting and keyword suggestions.\n- Eleven materials incl. order-independent transparency; perspective\u002Forthographic; depth-cue modes;\n  screen-space **ambient occlusion** and real-time **cast shadows**; solid\u002Fgradient background.\n- **Trajectory** loading + VMD-style playback (smoothing, frame trim\u002Fdecimate), on the desktop\n  **and in the browser** (the wasm build streams frames in from the picked file incrementally).\n- Atom **hover-info picking** and **lasso selection** (Atoms \u002F Residues \u002F Bound-H scopes, glowing\n  active selection), plus the **hover detail lens** revealing the atoms under a cartoon\u002Fsurface.\n- **Periodic images** with dashed wrap-around bonds; per-molecule periodic-box wireframe.\n- **Program settings** dialog with a persisted config file; save\u002Fload **sessions**; **export**\n  molecules and selections to file.\n- Undo\u002Fredo; drag-reorder reps; zoom-to-selection\u002Fmolecule.\n- **Browser build** — runs in the browser ([live demo](https:\u002F\u002Fyesint.github.io\u002Fmolar_vis\u002F));\n  WebGPU with a WebGL2 fallback; in-browser structure + trajectory loading.\n- **Python module** (native, Linux\u002FWindows) — `import molar_vis`, build molecules\u002Fselections with\n  the re-exported pymolar API, `spawn()` a live viewer and drive it (`add_mol`\u002F`add_rep`\u002Fproperty\n  setters); coordinate edits (`sel.translate(…)`) render live, zero-copy. See\n  [Scripting it from Python](#scripting-it-from-python).\n\n**In progress \u002F not done:**\n- Browser trajectory loading reads the whole file into memory (fine for typical sizes); true\n  random-access disk streaming for very large trajectories is a possible future addition.\n- The Python viewer runs on a background thread (Linux\u002FWindows); **macOS** (main-thread event loop)\n  support is planned.\n\nThis is a young project under active development; expect rough edges.\n\n## Built on molar\n\n`molar_vis` is a showcase for [molar](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar). Everything below\nthe rendering layer — reading files, building topology, guessing bonds, evaluating\nselections, assigning secondary structure — is molar. If you want to *analyze* rather\nthan *view* molecules in Rust (or Python), start there.\n\n## License\n\nDistributed under the **Artistic License 2.0**, the same license as molar.\n\n## Acknowledgements\n\nInspired by [VMD](https:\u002F\u002Fwww.ks.uiuc.edu\u002FResearch\u002Fvmd\u002F) (Theoretical and Computational\nBiophysics Group, University of Illinois) — its representations, selection language and\nnavigation are the model this project follows on a modern stack. Built with\n[egui](https:\u002F\u002Fgithub.com\u002Femilk\u002Fegui), [wgpu](https:\u002F\u002Fgithub.com\u002Fgfx-rs\u002Fwgpu) and\n[molar](https:\u002F\u002Fgithub.com\u002Fyesint\u002Fmolar).\n","molar_vis 是一个基于纯 Rust 实现的现代化分子可视化工具，专为结构生物学与计算化学领域设计。它采用 wgpu 渲染后端与 WGSL 编写的 GPU 光线投射 impostors 技术，支持原子\u002F键\u002F卡通带等六种 GPU 加速表示方式，并提供屏幕空间环境光遮蔽、顺序无关透明、深度提示、悬停放大镜等增强视觉体验的功能。项目完全不依赖 OpenGL 固定管线或 C\u002FC++ 库，原生支持 Linux\u002FWindows\u002FmacOS，并可编译为 WebAssembly 在浏览器中运行。适用于科研人员快速查看蛋白质、核酸等生物大分子三维结构，尤其适合需要跨平台一致性、内存安全性及轻量可定制性的本地或 Web 端分子分析场景。","2026-07-08 04:29:57","CREATED_QUERY"]