void Mesh::writemesh(char *out_path){
fstream outfile;
double p=3.14;double r=3.0;
outfile.open(out_path,ios::out);
outfile<<96<<" "<<20<<" "<<134<<"\n\n";
double N=4.0;
GLfloat theta = ( 2.0f * 3.1415926536 ) / N;
for(double i=0;i<=10;i+=(p/6))
{
r+=(p/6);
for(double c=0;c<N;c++){
outfile<<r*cos(theta * c)<<" "<<r*sin(theta * c)<<" "<<i<<"\n";
}
/*outfile<<(4+cos(r*p/6))*cos(i)<<" "<<(4+cos(r*p/6))*cos(i)+1.0<<" "<<(r*p/6)*sin(i)+2.0<<"\n";
outfile<<(4+cos(r*p/6))*cos(i)<<" "<<(4+cos(r*p/6))*cos(i)+2.0<<" "<<(r*p/6)*sin(i)+2.0<<"\n";
outfile<<(4+cos(r*p/6))*cos(i)<<" "<<(4+cos(r*p/6))*cos(i)+2.0<<" "<<(r*p/6)*sin(i)+1.0<<"\n";
outfile<<(4+cos(r*p/6))*cos(i)<<" "<<(4+cos(r*p/6))*cos(i)+1.0<<" "<<(r*p/6)*sin(i)+1.0<<"\n";*/
}
outfile<<"\n";
outfile<<"0 0 0"<<"\n";
outfile<<"\n";
for(double i=0;i<48;i=i+4.0)
{
outfile<<N;
for(double j=0;j<N;j++)
{
outfile<<" "<<i+j<<" 0";
}
outfile<<"\n";
outfile<<"4 "<<i+1<<" 0 "<<i+5.0<<" 0 "<<i+6.0<<" 0 "<<i+2.0<<" 0"<<"\n";
outfile<<"4 "<<i<<" 0 "<<i+4.0<<" 0 "<<i+5.0<<" 0 "<<i+1.0<<" 0"<<"\n";
outfile<<"4 "<<i+2.0<<" 0 "<<i+6.0<<" 0 "<<i+7.0<<" 0 "<<i+3.0<<" 0"<<"\n";
outfile<<"4 "<<i<<" 0 "<<i+3.0<<" 0 "<<i+7<<" 0 "<<i+4.0<<" 0"<<"\n";
}
outfile.close();
}