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
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
Pixel-precise manual modeling โ Hardware-accelerated 3D viewport with real-time atom selection, addition, deletion, element substitution, and multi-atom drag translation.
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.
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.
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.
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.
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.
### 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 boundaries
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Medium
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
Low
4/14/2026
main@2026-04-14
Latest activity on main branch
High
4/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
Medium
4/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-Sy
Medium
4/10/2026
v0.3.0
Latest release: v0.3.0
High
4/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 โ
Medium
4/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 Quant
Low
3/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.