diff --git a/wrap/io_trimesh/import_field.h b/wrap/io_trimesh/import_field.h index 1118fbb4..d6cb0327 100644 --- a/wrap/io_trimesh/import_field.h +++ b/wrap/io_trimesh/import_field.h @@ -81,6 +81,64 @@ public: return true; } + static bool LoadNDF(MeshType &mesh, + const char *path) + { + FILE *f = fopen(path,"rt"); + if (!f) + { + fflush(stdout); + return false; + } + + char skipstr[200]; + //int readed0; + do{ + + fscanf(f,"%s\n",&skipstr[0]); + printf("%s\n",skipstr); + }while(strcmp(skipstr,"[Pjumps]")!=0); + +// fscanf(f,"%s\"",skipstr); +// printf("%s\n",skipstr); + fseek(f, 7, SEEK_CUR); + char final[1]; + do{ + int period; + fscanf(f,"%d;",&period); + printf("%d\n",period); + fscanf(f,"%c",&final); + fseek(f, -1, SEEK_CUR); + printf("%s\n",&final[0]); + }while(strcmp(final,"\"")!=0); + +// printf("%s\n",skipstr); + printf("puppa!"); + fflush(stdout); +// for (int i=0;i UV[3]; +// UV[0]= vcg::Point2(u0,v0); +// UV[1]= vcg::Point2(u1,v1); +// UV[2]= vcg::Point2(u2,v2); +// CoordType dir1; +// CoordType dir2; +// vcg::tri::CrossField::GradientToCross(mesh.face[i],UV[0],UV[1],UV[2],dir1,dir2); +// dir1.Normalize(); +// dir2.Normalize(); +// mesh.face[i].PD1()=dir1; +// mesh.face[i].PD2()=dir2; +// } +// fclose(f); +// return true; + } + ///load a field on the mesh, it could be a vfield file (per vertex) ///or an ffield file (per face) static bool LoadFFIELD(MeshType &mesh,