*** empty log message ***
This commit is contained in:
parent
7f3c65238c
commit
9b09f1a95c
apps/sample/trimesh_ball_pivoting
|
@ -45,24 +45,22 @@ int main(int argc, char **argv)
|
||||||
"Usage: PlyRefine filein.ply fileout.ply [opt] \n"
|
"Usage: PlyRefine filein.ply fileout.ply [opt] \n"
|
||||||
"options: \n"
|
"options: \n"
|
||||||
"-r <val> radius of the rolling ball\n"
|
"-r <val> radius of the rolling ball\n"
|
||||||
|
"-c <val> clustering radius (as fraction of radius) default: 0.05\n"
|
||||||
);
|
);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int i=3;
|
float radius = 1.0f;
|
||||||
int CellNum=100000;
|
float clustering = 0.05;
|
||||||
float CellSize=0;
|
float crease =
|
||||||
bool DupFace=false;
|
|
||||||
|
|
||||||
while(i<argc)
|
while(i<argc)
|
||||||
{
|
{
|
||||||
if(argv[i][0]!='-')
|
if(argv[i][0]!='-')
|
||||||
{printf("Error unable to parse option '%s'\n",argv[i]); exit(0);}
|
{printf("Error unable to parse option '%s'\n",argv[i]); exit(0);}
|
||||||
switch(argv[i][1])
|
switch(argv[i][1])
|
||||||
{
|
{
|
||||||
case 'k' : CellNum=atoi(argv[i+1]); ++i; printf("Using %i clustering cells\n",CellNum); break;
|
case 'r' : radius = atof(argv[i+1]); printf("Using %f sphere radius\n",radius); break;
|
||||||
case 's' : CellSize=atof(argv[i+1]); ++i; printf("Using %5f as clustering cell size\n",CellSize); break;
|
case 'c' : clustering = atof(argv[i+1]); printf("Using %f clustering radius\n",clustering); break;
|
||||||
case 'd' : DupFace=true; printf("Enabling the duplication of faces for double surfaces\n"); break;
|
|
||||||
|
|
||||||
default : {printf("Error unable to parse option '%s'\n",argv[i]); exit(0);}
|
default : {printf("Error unable to parse option '%s'\n",argv[i]); exit(0);}
|
||||||
}
|
}
|
||||||
|
@ -82,14 +80,16 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
int t0=clock();
|
int t0=clock();
|
||||||
// Initialization
|
// Initialization
|
||||||
|
Pivot<MyMesh> pivot(m, radius, clustering);
|
||||||
|
|
||||||
int t1=clock();
|
int t1=clock();
|
||||||
// the main processing
|
// the main processing
|
||||||
|
while(pivot.addFace() != -1);
|
||||||
|
|
||||||
int t2=clock();
|
int t2=clock();
|
||||||
|
|
||||||
printf("Output mesh vn:%i fn:%i\n",m.vn,m.fn);
|
printf("Output mesh vn:%i fn:%i\n",m.vn,m.fn);
|
||||||
printf("Simplified in :%i msec (%i+%i)\n",t2-t0,t1-t0,t2-t1);
|
printf("Created in :%i msec (%i+%i)\n",t2-t0,t1-t0,t2-t1);
|
||||||
|
|
||||||
vcg::tri::io::PlyInfo pi;
|
vcg::tri::io::PlyInfo pi;
|
||||||
vcg::tri::io::ExporterPLY<MyMesh>::Save(m,argv[2],pi.mask);
|
vcg::tri::io::ExporterPLY<MyMesh>::Save(m,argv[2],pi.mask);
|
||||||
|
|
Loading…
Reference in New Issue