Subversion Repositories gelsvn

Rev

Rev 105 | Rev 185 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 105 Rev 178
Line 1... Line 1...
1
#include "CGLA/Mat4x4f.h"
1
#include "CGLA/Mat4x4f.h"
2
#include "Util/ArgExtracter.h"
2
#include "Util/ArgExtracter.h"
3
#include "Geometry/RGrid.h"
3
#include "Geometry/RGrid.h"
4
#include "Geometry/load_raw.h"
4
#include "Geometry/load_raw.h"
5
#include "Geometry/save_raw.h"
5
#include "Geometry/save_raw.h"
6
#include "HMeshUtil/obj_save.h"
6
#include "HMesh/obj_save.h"
7
#include "HMeshUtil/x3d_save.h"
7
#include "HMesh/x3d_save.h"
8
#include "HMeshUtil/caps_and_needles.h"
8
#include "HMesh/caps_and_needles.h"
9
#include "HMeshUtil/fair_polygonize.h"
9
#include "HMesh/fair_polygonize.h"
10
 
10
 
11
using namespace CGLA;
11
using namespace CGLA;
12
using namespace HMeshUtil;
-
 
13
using namespace Util;
12
using namespace Util;
14
using namespace HMesh;
13
using namespace HMesh;
15
using namespace std;
14
using namespace std;
16
using namespace Geometry;
15
using namespace Geometry;
17
 
16
 
Line 33... Line 32...
33
				file ="../../data/teddybear.raw";
32
				file ="../../data/teddybear.raw";
34
		else
33
		else
35
				file = ae.get_last_arg();
34
				file = ae.get_last_arg();
36
		
35
		
37
		RGridb grid(Vec3i(X,Y,Z));
36
		RGridb grid(Vec3i(X,Y,Z));
-
 
37
 
-
 
38
//		RGridb grid(Vec3i(32));
-
 
39
// 		srand(0);
-
 
40
// 		for(int i=0;i<32;++i)
-
 
41
// 			for(int j=0;j<32;++j)
-
 
42
// 				for(int k=0;k<32;++k)		
-
 
43
// 					grid[Vec3i(i,j,k)] = 80.0 * rand()/double(RAND_MAX);
-
 
44
 
38
		cout << "loading " << file << endl;
45
 		cout << "loading " << file << endl;
39
		load_raw(file,grid);
46
 		load_raw(file,grid);
40
		
47
		
41
		
48
		
42
		cout << "Polygonizing, iso = " << iso << endl;
49
		cout << "Polygonizing, iso = " << iso << endl;
43
		Manifold mani;
50
		Manifold mani;
44
		fair_polygonize(grid, mani, iso);
51
 		//fair_polygonize(grid, mani, iso);
45
 
-
 
46
		cout << "Removing caps and needles ... " << endl;
-
 
47
		remove_caps_from_trimesh(mani, M_PI * 0.85);
52
		cuberille_polygonize(grid, mani, iso, true);
48
		remove_needles_from_trimesh(mani, 1e-2);
-
 
49
		
53
		
50
		cout << "Saving" << endl;
54
		cout << "Saving" << endl;
51
		obj_save("../../data/isosurf.obj", mani);
55
		x3d_save("isosurf.x3d", mani);
52
}
56
}