High-performance crystal structure modeling, volumetric visualization, and DFT/MD file preparation β in a native desktop app.
CrystalCanvas is an open-source desktop GUI application designed for computational materials science, condensed matter physics, and quantum chemistry. It breaks free from the limitations of traditional tools (VESTA, Materials Studio) by combining a native-first architecture with modern AI-powered workflows.
- π±οΈ Pixel-precise manual modeling β Hardware-accelerated 3D view with real-time atom selection, addition, deletion, and element substitution.
- π Volumetric data visualization β Real-time isosurface extraction (GPU Marching Cubes) and volume raycasting for CHGCAR, Gaussian Cube, and XSF files. 10 scientific colormaps, dual-color signed isosurfaces, density cutoff control.
- βοΈ Industrial-grade physics kernel β C++ engine with Spglib (space group analysis), Eigen (matrix transforms), and Gemmi (CIF/PDB parsing).
- π§ 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 acts as a semantic parameterizer and command orchestrator with strict physics validation (MIC overlap checks).
- π Seamless DFT/MD integration β Native high-fidelity export for VASP (POSCAR), LAMMPS (Data), Quantum ESPRESSO (Input with automatic K-point density and IUPAC 2021 masses).
- π‘οΈ Memory-safe architecture β Rust logic layer eliminates crashes from dangling pointers and buffer overflows.
β οΈ 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.
Since releases are not signed with an Apple Developer Certificate, macOS will prevent it from running with a "Developer cannot be verified" warning.
To run the app:
- Move
CrystalCanvas.appto your/Applicationsfolder. - Right-click (or Control-click) the app icon and select Open.
- Click Open again in the dialog box.
Alternatively, run the following command in Terminal:
sudo xattr -cr /Applications/CrystalCanvas.appβββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β React + TypeScript + TailwindCSS (UI) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Rust / Tauri 2.0 (Application Logic / SSoT) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Rust / wgpu (Impostor Sphere + Volume Raycast) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β WGSL Compute (GPU Marching Cubes / Raycasting) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β C++ Physics Kernel (Spglib / Gemmi / Eigen) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology | Role |
|---|---|---|
| Presentation | React + TailwindCSS | UI panels, toolbars, chat |
| Application | Rust / Tauri 2.0 | State management, IPC, I/O pipeline |
| Rendering | Rust / wgpu | GPU-accelerated 3D (Metal / Vulkan / DX12) |
| Volumetric | WGSL Compute + Raycast | Isosurface extraction, volume rendering |
| Compute | C++ (Spglib, Gemmi, Eigen) | Symmetry, Overlap Detection, MIC |
| FFI Bridge | cxx (Rust β C++) |
Type-safe, zero-copy data transfer |
New to CrystalCanvas? Check out the User Manual (v0.1) for a comprehensive guide on modeling, AI workflows, and DFT exports.
CrystalCanvas utilizes a Zero-Global-Pollution strategy. All toolchains (Rust, Node) and dependencies are isolated within the project directory.
- Xcode Command Line Tools:
xcode-select --install - pnpm:
npm install -g pnpm(the only global dependency required)
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 installCrystalCanvas handles C++/Rust/TS full-stack compilation in a unified flow.
Always source the environment script before starting development to ensure RUSTUP_HOME and CARGO_HOME point to the project-local folders:
source dev_env.sh# This starts the Vite dev server and the Tauri native window
pnpm run tauri devTo verify GPU/wgpu compatibility without the full React UI:
cd src-tauri
RUST_LOG=info cargo run --bin render_demoControls: Left-click drag to rotate, scroll to zoom.
Note: The C++ kernel (Spglib, Gemmi, Eigen) is compiled automatically via the Rust
build.rsscript usingcxx-build. No manual CMake interaction is required.
- M1-M2: Infrastructure & Data Model β Rust/C++ bridge, CIF parsing.
- M3: High-Performance Rendering (wgpu) β Impostor spheres, ray-picking, orbital camera.
- M4-M6: UI Integration & Geometry Ops β Hybrid window, slab cleaving, supercells, atomic operations.
- M7-M8: DFT/MD Ecology & I/O Pipeline β Overlap detection (MIC), native exporters (VASP, QE, LAMMPS).
- M8.5: Persistent Settings & UI Polish β Local JSON caching, global rendering customization.
- M9: LLM Command Bus β Context-aware semantic AI agent for macro-scale geometry manipulation.
- M10: Structural Analysis & Phonons β Polyhedra identification, defect tracking, and imaginary frequency animation.
- M11: Volumetric Rendering β GPU Marching Cubes isosurfaces, volume raycasting, 10 colormaps, CHGCAR/Cube/XSF parsers.
- M12+: AI4Science Phase Space β High-throughput MLFF dataset perturbations, NEB playback, and Symmetry Subgroup extraction.
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)
β β βββ renderer/ # wgpu pipelines (atoms, bonds, isosurface, volume raycast)
β β βββ ... # State manager, command router, volumetric module
β βββ build.rs # Unified Rust + C++ build script (cmake/cxx bridge)
β βββ Cargo.toml
βββ src/ # React frontend (TypeScript + TailwindCSS components)
β βββ components/ # UI Panel components (RightSidebar: volumetric controls)
β βββ hooks/ # Custom React hooks (tauri events, file-drop, 3D interaction)
β βββ types/ # Strict TS IPC mappings (e.g., CrystalState, CrystalCommand)
βββ cpp/ # C++ physics kernel
β βββ include/ # Public C-compatible headers (cxx bridge)
β βββ src/ # Implementation code (Spglib, Gemmi, Eigen integrations)
β βββ CMakeLists.txt
βββ docs/ # System documentation ([User Manual](docs/UserManual_v0.1.md), Development Notes)
βββ tests/ # Integration tests & benchmark data (LFS-tracked volumetric files)
βββ dev_env.sh # Local toolchain environment activation script
βββ CHANGELOG.md # Release history and known issues
βββ README.md
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
- Primary dev platform: macOS (Intel & Apple Silicon)
- Environment toolchains should be installed locally within the project directory when possible (see
.gitignorefor excluded paths). - Documentation in
docs/andCHANGELOG.mdis tracked for release transparency.
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.
