183 |
jab |
1 |
#ifndef __HMESH_VOLUME_POLYGONIZE_H__
|
|
|
2 |
#define __HMESH_VOLUME_POLYGONIZE_H__
|
|
|
3 |
|
|
|
4 |
#include "Geometry/RGrid.h"
|
|
|
5 |
#include "HMesh/Manifold.h"
|
|
|
6 |
|
|
|
7 |
namespace HMesh
|
|
|
8 |
{
|
|
|
9 |
/** Polygonize by stitching cube faces.
|
|
|
10 |
This function works by asscociating a small box with each voxel.
|
|
|
11 |
A box face is recorded if it is shared by an interior voxel
|
|
|
12 |
(whose value is greater than the isovalue) and an exterior voxel
|
|
|
13 |
(i.e. whose value is below the isovalue). All created faces are
|
|
|
14 |
stitched together to form a mesh. The asymptotic decider is used
|
|
|
15 |
to do it properly.
|
|
|
16 |
*/
|
|
|
17 |
template<class T>
|
|
|
18 |
void cuberille_polygonize(const Geometry::RGrid<T>& voxel_grid,
|
|
|
19 |
HMesh::Manifold& mani, float iso,
|
|
|
20 |
bool push=false);
|
|
|
21 |
|
|
|
22 |
/** Marching cubes like polygonization (hence the "mc").
|
|
|
23 |
This function simply computes the dual of the result of
|
|
|
24 |
cuberille_polygonize. That is a mesh with the same connectivity
|
|
|
25 |
as that produced by MC, but the faces are polygons rather than
|
|
|
26 |
triangles. The vertex positions are also computed in the same
|
|
|
27 |
way as it is done in MC. */
|
|
|
28 |
template<class T>
|
|
|
29 |
void mc_polygonize(const Geometry::RGrid<T>& voxel_grid,
|
|
|
30 |
HMesh::Manifold& mani, float iso);
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
#endif
|