Subversion Repositories gelsvn

Rev

Rev 630 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 630 Rev 666
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
/**
7
/**
8
 * @file caps_and_needles.h
8
 * @file caps_and_needles.h
9
 * @brief Simple tools for improving polygonal meshes by removing bad triangles.
9
 * @brief Simple tools for improving polygonal meshes by removing bad triangles.
10
 */
10
 */
11
 
11
 
12
#ifndef __HMESH_CAPS_AND_NEEDLES_H__
12
#ifndef __HMESH_CAPS_AND_NEEDLES_H__
13
#define __HMESH_CAPS_AND_NEEDLES_H__
13
#define __HMESH_CAPS_AND_NEEDLES_H__
14
 
14
 
15
namespace HMesh
15
namespace HMesh
16
{
16
{
17
    class Manifold;
17
    class Manifold;
18
    /** \brief Remove caps from a manifold consisting of only triangles.
18
    /** \brief Remove caps from a manifold consisting of only triangles.
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.
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.
20
    Set the ang_thresh to a value close to pi. The closer to pi the _less_ sensitive the cap removal.
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. 
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 !!! */
22
    However, the function is more complex. Read code and document more carefully !!! */
23
    void remove_caps(Manifold& m, float thresh);
23
    void remove_caps(Manifold& m, float thresh);
24
 
24
 
25
    /** \brief Remove needles from a manifold consisting of only triangles.
25
    /** \brief Remove needles from a manifold consisting of only triangles.
26
    A needle is a triangle with a single very short edge. It is moved by collapsing the short edge. 
26
    A needle is a triangle with a single very short edge. It is moved by collapsing the short edge. 
27
    The thresh parameter sets the length threshold.		
27
    The thresh parameter sets the length threshold.		
28
    The position of the vertex which survives the collapse is set to one of the two end points. 
28
    The position of the vertex which survives the collapse is set to one of the two end points. 
29
    Selection is based on what changes the geometry least. */
29
    Selection is based on what changes the geometry least. */
30
    void remove_needles(Manifold& m, float thresh);
30
    void remove_needles(Manifold& m, float thresh);
31
    
31
    
32
    /** \brief Stitch together edges whose endpoints coincide geometrically. 
32
    /** \brief Stitch together edges whose endpoints coincide geometrically. 
33
     This function allows you to create a mesh as a bunch of faces and then stitch these together
33
     This function allows you to create a mesh as a bunch of faces and then stitch these together
34
     to form a coherent whole. What this function adds is a spatial data structure to find out
34
     to form a coherent whole. What this function adds is a spatial data structure to find out
35
     which vertices coincide. The return value is the number of edges that could not be stitched. 
35
     which vertices coincide. The return value is the number of edges that could not be stitched. 
36
     Often this is because it would introduce a non-manifold situation.*/
36
     Often this is because it would introduce a non-manifold situation.*/
37
    int stitch_mesh(Manifold& m);
37
    int stitch_mesh(Manifold& m, double rad);
38
 
38
 
39
    /** \brief Stitches the mesh together, splits edges that could not be stitched and goes again.
39
    /** \brief Stitches the mesh together, splits edges that could not be stitched and goes again.
40
     This function thereby handles situations where stitch mesh would not have worked. */
40
     This function thereby handles situations where stitch mesh would not have worked. */
41
    void stitch_more(Manifold& m);
41
    void stitch_more(Manifold& m, double rad);
42
 
42
 
43
    /** \brief This function replaces holes by faces.
43
    /** \brief This function replaces holes by faces.
44
     It is really a simple function that just finds all loops of edges next to missing faces. */
44
     It is really a simple function that just finds all loops of edges next to missing faces. */
45
    void close_holes(Manifold& m);
45
    void close_holes(Manifold& m);
46
    
46
    
-
 
47
    /** \brief Flip the orientation of a mesh.
-
 
48
     After calling this function, normals will point the other way and clockwise becomes 
-
 
49
     counter clockwise */
-
 
50
    void flip_orientation(Manifold& m);
-
 
51
    
-
 
52
    /** Remove valence two vertices. */
-
 
53
    void remove_valence_two_vertices(Manifold & m);
-
 
54
 
-
 
55
    
47
}
56
}
48
 
57
 
49
#endif
58
#endif
50
 
59
 
51

Generated by GNU Enscript 1.6.6.
60

Generated by GNU Enscript 1.6.6.
52
 
61
 
53
 
62
 
54
 
63