freshcrate
Skin:/
Home > AI Agents > CrystalCanvas

CrystalCanvas

High-performance crystal structure modeling and DFT/MD file preparation. Native desktop app fusing a Rust/C++ physics kernel, a GPU-accelerated Metal/Vulkan renderer, and an AI-driven command bus for

Why this rank:Release freshnessHealthy release cadenceStrong adoption

Description

High-performance crystal structure modeling and DFT/MD file preparation. Native desktop app fusing a Rust/C++ physics kernel, a GPU-accelerated Metal/Vulkan renderer, and an AI-driven command bus for semantic atomic manipulation.

README

CrystalCanvas Logo

CrystalCanvas

A next-generation, open-source crystal structure modeler โ€” built for the GPU era.

Legacy tools like VESTA and XCrySDen were pioneering in their time, but remain bound to single-threaded CPU rendering, decades-old GUI toolkits, and closed or stagnant codebases. CrystalCanvas is designed from scratch to close that gap: a Rust + wgpu + C++ native stack delivers real-time GPU-accelerated isosurface extraction and volume raycasting, a modern React/Tauri interface replaces 2000s-era widget UIs, and an AI-assisted command bus lets you manipulate structures with natural language โ€” capabilities no existing crystallographic tool offers. From interactive 3D modeling and publication-quality volumetric rendering to Brillouin Zone visualization, Wannier tight-binding overlays, and one-click DFT/MD file export, CrystalCanvas unifies the entire pre-computation workflow in a single, memory-safe application.

Current Release: v0.6.0 ยท Rust 15.5k LOC ยท TypeScript 3.9k LOC ยท C++ 737 LOC ยท 7 WGSL shaders


๐Ÿ“ฅ Download & Installation

Download for macOS

Warning

Important Note for macOS Users (Unverified Developer)

Because this is an open-source project and currently not signed with a paid Apple Developer Certificate, macOS will show a "Developer cannot be verified" warning and prevent the app from launching normally.

To run the app:

  1. Move CrystalCanvas.app to your /Applications folder.
  2. Right-click (or Control-click) the app icon and select Open.
  3. Click Open again in the dialog box.

Alternatively, run the following command in Terminal to clear the quarantine attribute:

sudo xattr -cr /Applications/CrystalCanvas.app

Crystal Structure Modeling

  • Pixel-precise manual modeling โ€” Hardware-accelerated 3D viewport with real-time atom selection, addition, deletion, element substitution, and multi-atom drag translation.
  • Cell standardization โ€” Niggli reduction, Delaunay reduction, Primitive โ†” Conventional cell transforms via Spglib.
  • Slab cleaving โ€” Rigorous $(h,k,l)$ surface cutting via Extended Euclidean Algorithm (Diophantine solver), not heuristic templates. Adjustable layer count, vacuum thickness, and termination selection.
  • Supercell generator โ€” Arbitrary $3\times3$ integer transformation matrices with automatic coordinate remapping and boundary deduplication.

Reciprocal Space & Electronic Structure

  • Brillouin Zone visualization โ€” 3D Wigner-Seitz cell construction (all 14 Bravais lattice types) and 2D BZ support (5 wallpaper group types) with high-symmetry $\mathbf{k}$-point labeling. One-click band path export for Quantum ESPRESSO and VASP.
  • Tight-Binding (Wannier) visualizer โ€” Parse wannier90_hr.dat hopping Hamiltonians $H = \sum_{\mathbf{R}} t_{ij}(\mathbf{R}) c^\dagger_{i,\mathbf{0}} c_{j,\mathbf{R}}$ and render as 3D network overlays with per-orbital color coding (10-color Material palette), $\mathbf{R}$-shell/orbital selection, magnitude filtering, and ghost atom rendering for neighboring cells.

Volumetric Data Visualization

  • GPU isosurface extraction โ€” Real-time Marching Cubes (GPU compute shader) for CHGCAR, Gaussian Cube, and XSF files.
  • Volume raycasting โ€” Depth-aware front-to-back compositing with Blinn-Phong shading. Nyquist-compliant step size eliminates Moirรฉ banding.
  • Dual-color signed isosurfaces โ€” Positive/negative lobes in distinct colormap-derived colors for Wannier functions and $\Delta\rho$. 10 scientific colormaps (Viridis, Coolwarm, RdYlBu, etc.).

DFT/MD Integration & AI

  • Seamless DFT/MD export โ€” Native high-fidelity export for VASP (POSCAR), LAMMPS (Data), Quantum ESPRESSO (Input with automatic K-point density and IUPAC 2021 masses).
  • AI-powered workflow (experimental) โ€” Natural language commands like "Generate a 3ร—3ร—3 silicon supercell and dope 5% phosphorus on the surface". Context-aware LLM agent with strict physics validation (MIC overlap checks).
  • Memory-safe architecture โ€” Rust logic layer eliminates crashes from dangling pointers and buffer overflows. All crystal state managed via SSoT (Single Source of Truth) with f64 physics / f32 GPU precision separation.

Roadmap

Completed

Version Highlights
v0.1.0 Hybrid window (wgpu + WebView), impostor sphere rendering, CIF parsing
v0.2.0 Slab cleaving (Diophantine), supercell, atom editing, DFT exporters
v0.3.0 Volumetric rendering (GPU Marching Cubes, volume raycasting, 10 colormaps)
v0.4.0 3D/2D Brillouin Zone, cell standardization (Niggli/Primitive/Conventional)
v0.5.0 Wannier tight-binding visualizer, icon toolbar UI redesign
v0.6.0 Distance/angle measurement, undo/redo stack, partial occupancy, commands.rs refactor

Planned

Version Target Key Features
v0.7.0 CMP Core In-GUI charge density difference ($\Delta\rho$), collinear magnetic moments ($m_z$), MSAA anti-aliasing
v0.8.0 Reciprocal Physics 3D Fermi surface viewer (.bxsf), non-collinear magnetism
v0.9.0+ Flagship Moirรฉ superlattice generator (twistronics), high-quality rendering engine (SSAO), symmetry element overlay

For the full roadmap, see ROADMAP.md.


Known Issues

Platform Support: Due to rendering engine (wgpu) backend differences, Windows and Linux builds may have rendering issues. Currently only macOS is fully tested and supported.


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  L4: React + TypeScript + TailwindCSS  (Presentation)   โ”‚
โ”‚      WebView / Tauri IPC (invoke / events)              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  L3: Rust / Tauri 2.0  (Application Logic / SSoT)       โ”‚
โ”‚      State Manager โ€ข Command Router โ€ข Undo Stack        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  L2: Rust / wgpu  (Rendering Engine)                    โ”‚
โ”‚      Impostor Spheres โ€ข Bond Cylinders โ€ข BZ Wireframe   โ”‚
โ”‚      Volume Raycast โ€ข GPU Marching Cubes โ€ข Wannier Net  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  L1: C++ Physics Kernel  (Spglib / Gemmi / Eigen)       โ”‚
โ”‚      Symmetry โ€ข Slab โ€ข Supercell โ€ข Overlap Detection    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Layer Technology Role
L4 Presentation React + TailwindCSS UI panels, icon toolbar, chat, measurement overlays
L3 Application Rust / Tauri 2.0 SSoT state management, IPC, I/O pipeline, undo stack
L2 Rendering Rust / wgpu (WGSL) GPU-accelerated 3D (Metal / Vulkan / DX12), isosurface, BZ
L1 Compute C++ (Spglib, Gemmi, Eigen) Symmetry analysis, slab geometry, bonding (MIC)
FFI Bridge cxx (Rust โ†” C++) Type-safe, zero-copy data transfer, exception isolation

Key Design Decisions:

  • Dual-precision: f64 for crystallographic calculations, f32 for GPU rendering
  • ColMajor enforcement: All lattice matrices follow Fortran column-major order throughout the stack
  • Full GPU reconstruction: Instance buffer rebuilt on every state change (~16 KB for 500 atoms, < 0.1 ms)
  • Three-layer LLM safety: Schema validation โ†’ physics sandbox โ†’ undo snapshot before every AI-generated command

Getting Started

New to CrystalCanvas? Check out the User Manual for a comprehensive guide.

For more in-depth documentation, see the Documentation section below.

CrystalCanvas utilizes a Zero-Global-Pollution strategy. All toolchains (Rust, Node) and dependencies are isolated within the project directory.

1. Prerequisites (macOS)

  • Xcode Command Line Tools: xcode-select --install
  • pnpm: npm install -g pnpm (the only global dependency required)

2. Initial Setup

Clone the repository and initialize the local toolchains:

git clone https://github.com/XiaoJiang-Phy/CrystalCanvas.git
cd CrystalCanvas

# Initialize local Rustup and Cargo home
mkdir -p .rustup .cargo
source dev_env.sh

# Install Rust stable locally (if not present)
rustup toolchain install stable

# Install Node dependencies
pnpm install

3. Build & Run

Activation

Always source the environment script before starting development:

source dev_env.sh

Run in Development Mode

# This starts the Vite dev server and the Tauri native window
pnpm run tauri dev

Run Standalone Rendering Demo

To verify GPU/wgpu compatibility without the full React UI:

cd src-tauri
RUST_LOG=info cargo run --bin render_demo

Controls: Left-click drag to rotate, scroll to zoom.

Note: The C++ kernel (Spglib, Gemmi, Eigen) is compiled automatically via the Rust build.rs script using cxx-build. No manual CMake interaction is required.


Project Structure

CrystalCanvas/
โ”œโ”€โ”€ .github/            # GitHub Actions (CI/CD release workflows)
โ”œโ”€โ”€ src-tauri/          # Rust backend (Tauri commands, state handling, wgpu orchestration)
โ”‚   โ”œโ”€โ”€ shaders/        # WGSL shaders (volume_raycast, marching_cubes, isosurface_render)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ io/         # File parsers (CIF, POSCAR, CHGCAR, Cube, XSF, QE, wannier90_hr)
โ”‚   โ”‚   โ”œโ”€โ”€ renderer/   # wgpu pipelines (atoms, bonds, hopping, isosurface, volume, BZ)
โ”‚   โ”‚   โ””โ”€โ”€ ...         # State manager, command router, volumetric, wannier, BZ modules
โ”‚   โ”œโ”€โ”€ build.rs        # Unified Rust + C++ build script (cmake/cxx bridge)
โ”‚   โ””โ”€โ”€ Cargo.toml
โ”œโ”€โ”€ src/                # React frontend (TypeScript + TailwindCSS components)
โ”‚   โ”œโ”€โ”€ components/     # UI components (icon toolbar, panels, chat)
โ”‚   โ”œโ”€โ”€ hooks/          # Custom React hooks (tauri events, file-drop, 3D interaction)
โ”‚   โ””โ”€โ”€ types/          # Strict TS IPC type mappings
โ”œโ”€โ”€ cpp/                # C++ physics kernel
โ”‚   โ”œโ”€โ”€ include/        # Public C-compatible headers (cxx bridge)
โ”‚   โ”œโ”€โ”€ src/            # Spglib, Gemmi, Eigen integrations
โ”‚   โ””โ”€โ”€ CMakeLists.txt
โ”œโ”€โ”€ doc/                # Internal technical docs (TDD, Roadmap, Feature Assessment)
โ”œโ”€โ”€ docs/               # Public documentation
โ”‚   โ”œโ”€โ”€ UserManual.md       # End-user guide
โ”‚   โ”œโ”€โ”€ DeveloperGuide.md   # Architecture & contribution guide
โ”‚   โ”œโ”€โ”€ Algorithms.md       # Core algorithm specifications
โ”‚   โ”œโ”€โ”€ IPC_Commands.md     # Complete Tauri IPC command reference
โ”‚   โ”œโ”€โ”€ Shader_Reference.md # WGSL shader bind groups & pipelines
โ”‚   โ”œโ”€โ”€ TestingGuide.md     # Node TDD process & test inventory
โ”‚   โ””โ”€โ”€ FAQ.md              # Troubleshooting & common issues
โ”œโ”€โ”€ tests/              # Integration tests & benchmark data (LFS-tracked volumetric files)
โ”œโ”€โ”€ dev_env.sh          # Local toolchain environment activation script
โ”œโ”€โ”€ CHANGELOG.md        # Release history
โ””โ”€โ”€ README.md

Documentation

Document Audience Description
User Manual End users Feature walkthrough, import/export, UI guide
Developer Guide Contributors Architecture, build system, coding conventions
Algorithms Developers / Researchers Mathematical formulations (Slab, BZ, Marching Cubes, Ray-Picking, etc.)
IPC Commands Frontend developers All 55 Tauri invoke() signatures with types and side effects
Shader Reference GPU developers Bind group layouts, vertex formats, lighting parameters for all 7 WGSL shaders
Testing Guide Contributors Node TDD process, test inventory (12 Rust + 6 C++), tolerances
FAQ All Installation troubleshooting, rendering issues, common errors

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Development Notes

  • Primary dev platform: macOS (Intel & Apple Silicon)
  • Environment: Always source dev_env.sh before building. API keys stored in OS Keychain โ€” never in code or logs.
  • Code conventions: snake_case for variables/functions, PascalCase for types, physics symbol fidelity preserved (e.g., sigma_k โ‰  Sigma_K). See CONTRIBUTING.md for full guidelines.
  • Documentation: Internal docs in doc/, public docs in docs/. Changes tracked in CHANGELOG.md.

License

This project is dual-licensed under the MIT License and the Apache License 2.0. You may choose either license for your use.

For third-party software licenses used in this project, please see THIRD_PARTY_LICENSES.md.


Acknowledgments

  • Spglib โ€” Crystal symmetry analysis
  • Gemmi โ€” CIF/PDB file parsing
  • Eigen โ€” Linear algebra
  • Tauri โ€” Desktop app framework
  • wgpu โ€” Cross-platform GPU API

Release History

VersionChangesUrgencyDate
v0.6.0### Added - **Measurement Tool**: Interactive distance, angle, and dihedral angle measurements. - Auto-detects 2/3/4 selected atoms and computes exact distances ($|P_i - P_j|$) or angles. - Generates persistent rendering of dashed lines with measurement results placed via coordinate projection. - **Undo / Redo Stack**: Action historical tracing and state rollback via keyboard (`Cmd+Z` / `Cmd+Shift+Z`). - Utilizes a `LightweightState` data structure, storing only crystallographic boundariesMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchMedium4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchLow4/14/2026
main@2026-04-14Latest activity on main branchHigh4/14/2026
v0.5.0### Added - **โšก Tight-Binding (Wannier) Visualizer**: Parse `wannier90_hr.dat` and visualize the hopping Hamiltonian $H = \sum_{\mathbf{R}} t_{ij}(\mathbf{R}) c^\dagger_{i,\mathbf{0}} c_{j,\mathbf{R}}$ as an interactive 3D network overlay. - **Hopping Network Rendering**: Instanced cylinder rendering for inter-atomic hoppings with per-orbital color coding (Google Material 500-level palette, 10 colors, mod-cycle). - **Magnitude Filtering**: Adjustable $|t|$ threshold slider to suppress noise Medium4/11/2026
v0.4.0### Added - **๐Ÿ”ท Brillouin Zone Visualization**: Full reciprocal-space analysis pipeline with interactive BZ rendering. - **3D Wigner-Seitz Construction**: Voronoi-based BZ generation covering all 14 Bravais lattice types (Setyawan-Curtarolo 2010 convention). - **2D BZ Support**: Automated 2D material detection (vacuum gap + c/a ratio heuristics) with Sutherland-Hodgman polygon clipping for 5 wallpaper group types (Hexagonal, Square, Rectangular, Centered-Rectangular, Oblique). - **High-SyMedium4/10/2026
v0.3.0Latest release: v0.3.0High4/9/2026
v0.2.0### Fixed - **๐Ÿ”ง Slab Cleaving Algorithm**: Complete rewrite of the slab generation pipeline, resolving the critical topology bug reported in v0.1.0-alpha. - **Root Cause 1 โ€” Eigen Memory Layout**: `EIGEN_DEFAULT_TO_ROW_MAJOR=0` in CMakeLists.txt paradoxically enabled RowMajor storage due to Eigen's `#ifdef` (existence check) vs `#if` (value check) preprocessor semantics. All non-diagonal C++โ†”Rust matrix transfers were silently transposed. Removed the erroneous define. - **Root Cause 2 โ€” Medium4/5/2026
v0.1.0### Added - **Alpha Release**: Initial MVP build. - **High-Performance Renderer**: `wgpu` based orbital camera with Impostor Sphere and Ray-Picking for ~1000 atomic structures at 60 FPS. - **Physics Kernel**: C++ engine with `Spglib` Space Group Analysis and `Gemmi` high-speed CIF parser integration via Rust FFI (`cxx`). - **Interactive Modeling**: Real-time addition, deletion, element replacement, and supercell generation. - **DFT/MD Native IO**: Built-in VASP (POSCAR), LAMMPS (Data), and QuantLow3/6/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

scorpio-analystYour personal Multi-Agent portfolio manager and financial analyst teamv0.7.1
scraping-browser๐Ÿ” Automate dynamic web scraping with Scraping Browser, a full-host solution using Puppeteer, Selenium, and Playwright for seamless data collection.main@2026-06-07
ComfyUI-LoaderUtils๐Ÿ”„ Optimize model loading in ComfyUI with flexible node connections and controlled sequences for better performance and memory management.main@2026-06-06
Paper2Slides๐Ÿ“Š Transform research papers into professional slides and posters seamlessly and quickly with Paper2Slides, saving you valuable time.main@2026-06-06
llm-batch๐Ÿš€ Process JSON data in batches with `llm-batch`, leveraging sequential or parallel modes for efficient interaction with LLMs.main@2026-06-06

More in AI Agents

@blockrun/franklinFranklin โ€” The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.
hermes-agentThe agent that grows with you
awesome-copilotCommunity-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.
e2bE2B SDK that give agents cloud environments