OgreWulff
A Python package for generating and plotting Wulff shapes from surface energy data, based on WulffPack.
Installation
From source
pip install -e .
From PyPI
pip install OgreWulff
Usage
Wulff shape from surface energies
from OgreWulff import plot_wulff
from ase.build import bulk
# Define surface energies (in mJ/m^2)
surface_energies = {
(1, 0, 0): 100.0,
(1, 1, 0): 85.0,
(1, 1, 1): 75.0
}
conv = bulk('Cu', 'fcc', a=3.6, cubic=True)
# Interactive HTML (Plotly)
plot_wulff(surface_energies=surface_energies, structure=conv, output_file='cu_wulff.html', interactive=True, legend=True)
# Static PNG (matplotlib)
plot_wulff(surface_energies=surface_energies, structure=conv, output_file='cu_wulff.png', interactive=False, legend=True)
BFDH morphology (no surface energies needed)
The Bravais–Friedel–Donnay–Harker (BFDH) model predicts crystal morphology purely from lattice geometry: facets with larger interplanar spacings grow slower and therefore dominate the crystal habit.
from OgreWulff import plot_wulff_BFDH
from ase.build import bulk
conv = bulk('Cu', 'fcc', a=3.6, cubic=True)
particle = plot_wulff_BFDH(structure=conv, output_file='cu_wulff_bfdh.png', interactive=True, legend=True)
Features
- Wulff shape construction: Create equilibrium crystal shapes from surface energies
- Static plotting: Generate high-quality PNG figures using matplotlib
- Interactive plotting: Create rotatable 3D visualizations with Plotly (optional)
- Facet filtering: Control which facets to include using
max_indexparameter - Customizable appearance: Control viewing angles, colors, legends, and more
API Reference
plot_wulff
Main function for plotting Wulff shapes.
Parameters:
surface_energies(dict): Dictionary mapping Miller index tuples to surface energies (in mJ/m^2)structure: ASE Atoms or pymatgen Structure for the conventional celloutput_file(str): Path to save the plot (optional, defaults to 'wulff_shape.png' or 'wulff_shape.html')legend(bool): Whether to show legend (default: False)elevation(int): Viewing elevation angle in degrees (default: 30)azimuth(int): Viewing azimuth angle in degrees (default: -60)use_common_viewing_angle(bool): Use elevation=30 and azimuth=30 (default: False)no_title(bool): Hide the title (default: False)title(str): Custom plot title (optional)max_index(int or dict): Filter facets by Miller index magnitude (optional)interactive(bool): Use Plotly for interactive visualization (default: False)natoms(int): Number of atoms for Wulff construction (default: 1000)symprec(float): Symmetry precision for spglib (default: 0.01)tol(float): Numerical tolerance (default: 1e-5)
Returns:
OgreSingleCrystal: The Wulff shape particle object
Dependencies
- numpy
- matplotlib
- plotly
- ase
- pymatgen
- wulffpack
- tqdm
License
MIT License
Metadata
Release files for OgreWulff 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ogrewulff-0.2.0.tar.gz | 19.2 kB | Without provenance | Details for ogrewulff-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ogrewulff-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ogrewulff-0.2.0-py3-none-any.whl |
Total release size: 40.9 kB
Release files / ogrewulff-0.2.0.tar.gz
| Download URL | ogrewulff-0.2.0.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
62147211fb782bc514f272f03996dba7ec935f118d644d44cb59b603a3b8c8ce
|
|
BLAKE2b-256 checksum How to use checksums |
c1ada88f15d8674c44a00345c32ace064a40d6447877c71ba99ef0272286541c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / ogrewulff-0.2.0-py3-none-any.whl
| Download URL | ogrewulff-0.2.0-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0acce7e774efbcd302772695444f61001386c90b6b28cc9ef815abb1a0591ffd
|
|
BLAKE2b-256 checksum How to use checksums |
33ba3d467c4b69b162feb379cfca985054be77ef8a1dd1341bed1b40711d4d47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for OgreWulff 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.