Python module for drawing and rendering beautiful atoms and molecules using Blender.
Python module for drawing and rendering beautiful atoms and molecules using Blender.
Batoms is a Python package for editing and rendering atoms and molecule objects using Blender. A Python interface that allows for automating workflows.
Features:
Flexible: Python script, run interactively or in the background.High quality rendering: 3D modelsFree, Open Source: Easy to download and install.Cross-platform: (Linux, Windows, macOS)Please visit the documentation for more information.
Another package, weas-widget, allows users to visualize and edit with atomistic structures in Jupyter Notebook.
One can build the extension locally by following the steps below.
Download wheels for ase and scikit-image:
pip download ase scikit-image --dest ./batoms/wheels --only-binary=:all: --python-version=3.11 --platform=manylinux_2_17_x86_64
pip download ase scikit-image --dest ./batoms/wheels --only-binary=:all: --python-version=3.11 --platform=win_amd64
pip download ase scikit-image --dest ./batoms/wheels --only-binary=:all: --python-version=3.11 --platform=macosx_12_0_arm64Update the wheels in the batoms/blender_manifest.toml file.
python scripts/update_wheels.pyBuild the extension.
blender --command extension build --source-dir batoms --output-dir .We recommend using Visual Studio Code with the Blender extension.
In order to develop it inside VSCode, you need at least update the wheel file in the batoms/blender_manifest.toml file using the steps above.
To run the tests, run:
# install pytest
~/apps/blender-4.3.2-linux-x64/4.3/python/bin/python3.11 -m pip install pytest
# run all tests
~/apps/blender-4.3.2-linux-x64/blender -b -P scripts/run_tests.py -- -vv tests
# run a specific test
~/apps/blender-4.3.2-linux-x64/blender -b -P scripts/run_tests.py -- -vv tests/test_batoms.pyTo install the pre-commit hooks, run:
$ pre-commit installNo open issues yet, or sync has not completed.