Subversion Repositories gelsvn

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

#ifndef __HMESH_VOLUME_POLYGONIZE_H__
#define __HMESH_VOLUME_POLYGONIZE_H__

#include "Geometry/RGrid.h"
#include "HMesh/Manifold.h"

namespace HMesh
{
                /** Polygonize by stitching cube faces.
                                This function works by asscociating a small box with each voxel.
                                A box face is recorded if it is shared by an interior voxel 
                                (whose value is greater than the isovalue) and an exterior voxel 
                                (i.e. whose value is below the isovalue). All created faces are 
                                stitched together to form a mesh. The asymptotic decider is used
                                to do it properly. 
                */
        template<class T>
        void cuberille_polygonize(const Geometry::RGrid<T>& voxel_grid, 
                                                                                                                HMesh::Manifold& mani, float iso,
                                                                                                                bool push=false);

        /** Marching cubes like polygonization (hence the "mc").
                        This function simply computes the dual of the result of 
                        cuberille_polygonize. That is a mesh with the same connectivity
                        as that produced by MC, but the faces are polygons rather than
                        triangles. The vertex positions are also computed in the same
                        way as it is done in MC. */
        template<class T>
        void mc_polygonize(const Geometry::RGrid<T>& voxel_grid,
                                                                                         HMesh::Manifold& mani, float iso);
}


#endif