Subversion Repositories gelsvn

Rev

Rev 62 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 62 Rev 97
Line 12... Line 12...
12
using namespace HMesh;
12
using namespace HMesh;
13
 
13
 
14
int main(int argc, char** argv)
14
int main(int argc, char** argv)
15
{
15
{
16
    Manifold m;
16
    Manifold m;
-
 
17
		if(argc>1)
17
    x3d_load(argv[1], m);
18
			x3d_load(argv[1], m);
-
 
19
		else
-
 
20
			x3d_load("../../data/small.x3d", m);
18
    
21
    
19
    Vec3f p0, p7;
22
    Vec3f p0, p7;
20
    m.get_bbox(p0, p7);
23
    m.get_bbox(p0, p7);
21
    Vec3f d = p7-p0;
24
    Vec3f d = p7-p0;
22
    float s = 1.0/d.max_coord();
25
    float s = 1.0/d.max_coord();
Line 26... Line 29...
26
    {
29
    {
27
				vi->pos = (vi->pos - p0) * s;
30
				vi->pos = (vi->pos - p0) * s;
28
    }
31
    }
29
    
32
    
30
    cout << "Perform quadric based simplification ... " << endl;
33
    cout << "Perform quadric based simplification ... " << endl;
-
 
34
    if(argc>2)
31
    quadric_simplify(m,atoi(argv[2]));
35
			quadric_simplify(m,atoi(argv[2]));
-
 
36
		else
-
 
37
			quadric_simplify(m,1500);
32
    
38
    
33
    cout << "Removing caps and needles ... " << endl;
39
    cout << "Removing caps and needles ... " << endl;
34
    remove_caps_from_trimesh(m, M_PI * 0.85);
40
    remove_caps_from_trimesh(m, M_PI * 0.85);
35
    remove_needles_from_trimesh(m, 1e-4);
41
    remove_needles_from_trimesh(m, 1e-4);
36
    
42
    
37
    cout << "Validity: " << m.is_valid() << endl;
43
    cout << "Validity: " << m.is_valid() << endl;
38
    cout << "Now saving ... " << endl;
44
    cout << "Now saving ... " << endl;
39
    x3d_save("decimated.x3d", m);
45
    x3d_save("../../data/decimated.x3d", m);
40
}
46
}