Giter Club home page Giter Club logo

den2obj's Introduction

Den2Obj

GitHub tag (latest SemVer) C/C++ CI OpenVDB build CI codecov 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

Canonical valence orbitals of CH4

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 liblzma-dev zlib1g-dev libbz2-dev libssl-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.

Getting the dependencies

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

Next download and install OpenVDB.

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.

Shared library

Den2Obj can also be used as a shared library in your own code. See the examples/shared for an example.

den2obj's People

Contributors

ifilot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

den2obj's Issues

Refactor user input

Reduce the number of command line argument directives and base the choices on filenames.

OpenVDB support?

This software is tagged openvdb, and if it could read .vdb files, it'd be exactly what I was looking for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.