Line -... |
Line 1... |
- |
|
1 |
/* ----------------------------------------------------------------------- *
|
- |
|
2 |
* This file is part of GEL, http://www.imm.dtu.dk/GEL
|
- |
|
3 |
* Copyright (C) the authors and DTU Informatics
|
- |
|
4 |
* For license and list of authors, see ../../doc/intro.pdf
|
- |
|
5 |
* ----------------------------------------------------------------------- */
|
- |
|
6 |
|
- |
|
7 |
/**
|
- |
|
8 |
* @file caps_and_needles.h
|
- |
|
9 |
* @brief Simple tools for improving polygonal meshes by removing bad triangles.
|
- |
|
10 |
*/
|
- |
|
11 |
|
1 |
#ifndef __HMESH_CAPS_AND_NEEDLES_H__
|
12 |
#ifndef __HMESH_CAPS_AND_NEEDLES_H__
|
2 |
#define __HMESH_CAPS_AND_NEEDLES_H__
|
13 |
#define __HMESH_CAPS_AND_NEEDLES_H__
|
3 |
|
14 |
|
4 |
#include "HMesh/Manifold.h"
|
- |
|
5 |
|
- |
|
6 |
namespace HMesh
|
15 |
namespace HMesh
|
7 |
{
|
16 |
{
|
- |
|
17 |
class Manifold;
|
8 |
/** A cap is a triangle with two very small angles and an angle close
|
18 |
/** \brief Remove caps from a manifold consisting of only triangles.
|
9 |
to pi, however a cap does not necessarily have a very short edge.
|
19 |
A cap is a triangle with two very small angles and an angle close to pi, however a cap does not necessarily have a very short edge.
|
10 |
Set the ang_thresh to a value close to pi. The closer to pi the
|
20 |
Set the ang_thresh to a value close to pi. The closer to pi the _less_ sensitive the cap removal.
|
- |
|
21 |
A cap is removed by flipping the (long) edge E opposite to the vertex V with the angle close to pi.
|
- |
|
22 |
However, the function is more complex. Read code and document more carefully !!! */
|
11 |
_less_ sensitive the cap removal.
|
23 |
void remove_caps(Manifold& m, float thresh);
|
12 |
|
24 |
|
13 |
A cap is removed by flipping the (long) edge E opposite to the vertex
|
25 |
/** \brief Remove needles from a manifold consisting of only triangles.
|
14 |
V with the angle close to pi. However, the function is more complex.
|
- |
|
15 |
Read code and document more carefully !!!
|
- |
|
16 |
*/
|
- |
|
17 |
void remove_caps_from_trimesh(HMesh::Manifold& mani, float ang_thresh);
|
- |
|
18 |
|
- |
|
19 |
/** A needle is a triangle with a single very short edge. It is moved
|
26 |
A needle is a triangle with a single very short edge. It is moved by collapsing the short edge.
|
20 |
by collapsing the short edge. The thresh parameter sets the length
|
27 |
The thresh parameter sets the length threshold.
|
21 |
threshold.
|
- |
|
22 |
|
- |
|
23 |
The position of the vertex which survives the collapse is set to one
|
28 |
The position of the vertex which survives the collapse is set to one of the two end points.
|
24 |
of the two end points. Selection is based on what changes the geometry
|
29 |
Selection is based on what changes the geometry least. */
|
25 |
least. */
|
- |
|
26 |
void remove_needles_from_trimesh(HMesh::Manifold& mani,
|
30 |
void remove_needles(Manifold& m, float thresh);
|
27 |
float thresh);
|
- |
|
28 |
}
|
31 |
}
|
29 |
|
32 |
|
30 |
#endif
|
33 |
#endif
|
31 |
|
34 |
|