Git Product home page Git Product logo

dualmc's Introduction

Introduction

This project provides a simple C++ implementation of the dual marching cubes algorithm described in the paper Dual Marching Cubes from Gregory M. Nielson. It is a byproduct of some work I did as a student assistent back in 2009. Though there are other implementations out there it might still be helpfull to someone.

Unfortunately, under rare circumstances the original algorithm can create non-manifold meshes. See the remarks of the original paper on this problem. In chapter 3.3.5 of his book "Isosurfaces: Geometry, Topology, and Algorithms" Rephael Wenger proposed the manifold dual marching cubes algorithm as a possible solution, which is also included in this implementation.

Requirements

  • C++11
  • No other dependencies

Implementation

The algorithm is implemented in the files dualmc.h, dualmc.tpp, and dualmc_tables.tpp. A simple example command-line application which demonstrates basic usage is provided as well. An application for generating the (manifold) dual marching cubes tables is implemented in apps/gentables.

Dual point computation could be improved using Hermite data or at least first derivatives as described in Dual Contouring of Hermite Data. So feel free to contribute :)

Example Application

To build the example and see the available options in a Linux environment type:

$ make
$ ./dmc -help

A basic CMAKE file is provided as well. If this still does not suit you under Windows or OS X the adept programmer should have no problems setting up a small project.

RAW Files

The example application can only read 8-bit and 16-bit volume data sets in the very limited RAW format (i.e. only stores raw data, no further information such as the volume grid dimension is included). A classic source for RAW files is http://www.volvis.org/ . Currently, the site does not seem to be available. The OpenQVis project also provides some data sets in RAW format. Another source is The Volume Library from Stefan Roettger. This site provides files in the more versatile PMV format but also code which can convert these files to RAW.

The example application provides a small cube data set (32^3)and can also generate a caffeine molecule. To extract a surface from the cube volume type:

$ ./dmc -raw data/cube.raw 32 32 32 -iso 0.5

The iso value of 0.5 is mapped to a middle density w.r.t. the bit-depth of the data set. For the caffeine data set type:

$ ./dmc -caffeine -iso 0.5

caffeine

For code simplicity the example outputs surfaces in the Wavefront OBJ format.

License

BSD 3-Clause License

dualmc's People

Contributors

dominikwodniok avatar

Watchers

 avatar

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.