ifilot / den2obj

Generate isosurface from density data

Home Page:https://den2obj.imc-tue.nl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Den2Obj

GitHub tag (latest SemVer) C/C++ CI OpenVDB build CI Documentation License: GPL v3

Purpose

Den2Obj is a command-line tool that construct isosurfaces from densely packed scalar fields. Den2Obj supports VASP charge files such as CHGCAR and PARCHG, Gaussian .cube files as well as its own .d2o format.

Example images

3D Reaction-Diffusion system

The isosurface above represents the concentration profile of a reaction-diffusion system in 3D using Gray-Scott kinetics. The isosurface has been generated using den2obj and rendered using [Blender] (https://www.blender.org/).

Molecular orbitals of CO

The isosurfaces of the first 10 molecular orbitals of the CO molecule.

Compilation instructions

Debian Latest

Getting the dependencies

sudo apt install build-essential cmake libtclap-dev libboost-all-dev libopenvdb-dev libtbb-dev \
pkg-config libcppunit-dev libeigen3-dev

To compile, run the following commands:

git clone https://github.com/ifilot/den2obj.git
cd den2obj
mkdir build
cd build
cmake -DMOD_OPENVDB=1 ../src
make -j5

Ubuntu Latest

The stable OpenVDB library (libopenvdb) under Ubuntu is incompatible with the Threading Building Blocks (libtbb) library. To solve this, manually compile and install OpenVDB 8.2 using the following instructions.

get https://github.com/AcademySoftwareFoundation/openvdb/archive/refs/tags/v8.2.0.tar.gz
tar -xvzf v8.2.0.tar.gz
mkdir openvdb-build && cd openvdb-build && cmake ../openvdb-8.2.0 -DCMAKE_INSTALL_PREFIX=/opt/openvdb
make -j9 && sudo make install

Thereafter, clone, configure and compile Den2Obj and link against OpenVDB 8.2.

git clone https://github.com/ifilot/den2obj.git
cd den2obj
mkdir build
cd build
cmake -DMOD_OPENVDB=1 ../src
make -j5

Usage

Isosurfaces

<path to>/den2obj -i CHGCAR -o <filename.obj> -v <isovalue>

Example:

./den2obj -i CHGCAR -o orbital.obj -v 0.1

Options

  • -c: Center the structure, i.e. the center of the structure is placed at the origin of the coordinate system.
  • -t: Converts one file format to another. File formats are auto-recognized based on the extensions.

Conversions

Converting CHGCAR to OpenVDB

./den2obj -i CHGCAR_xxx -o xxx.vdb -t

Converting CHGCAR to D2O

./den2obj -i CHGCAR_xxx -o xxx.d2o -t

Supported input types:

  • CHGCAR
  • PARCHG
  • LOCPOT
  • Gaussian cube (.cub)
  • D2O files (.d2o)

Supported dense output types:

  • D2O
  • OpenVDB

Supported isosurface object types:

D2O file format

The D2O file format is native to Den2Obj. This file format stores the scalarfield in binary format and uses compression to generate small files which are fast to read from. More information on the file format can be found in the documentation.

About

Generate isosurface from density data

https://den2obj.imc-tue.nl/

License:GNU General Public License v3.0


Languages

Language:C++ 81.2%Language:C 8.9%Language:CMake 5.2%Language:TeX 2.3%Language:Python 2.1%Language:Shell 0.2%Language:Dockerfile 0.0%