29 #include<vcg/complex/complex.h>
30 #include<vcg/complex/algorithms/create/platonic.h>
33 #include <wrap/io_trimesh/export_off.h>
38 struct MyUsedTypes :
public vcg::UsedTypes< vcg::Use<MyVertex>::AsVertexType, vcg::Use<MyFace>::AsFaceType>{};
40 class MyVertex :
public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::Normal3f, vcg::vertex::Color4b, vcg::vertex::BitFlags >{};
41 class MyFace :
public vcg::Face < MyUsedTypes, vcg::face::VertexRef, vcg::face::Normal3f, vcg::face::FFAdj, vcg::face::BitFlags > {};
42 class MyMesh :
public vcg::tri::TriMesh< std::vector<MyVertex>, std::vector<MyFace> > {};
52 vector<Point3f> coordVec;
53 vector<Point3i> indexVec;
54 coordVec.push_back(Point3f(0,0,0));
55 for(
int i=0;i<36;++i) {
56 float angleRad = float(i)*M_PI/18.0;
57 coordVec.push_back(Point3f(sin(angleRad),cos(angleRad),0));
58 indexVec.push_back(Point3i(0,i+1,1+(i+1)%36));
62 tri::io::ExporterOFF<MyMesh>::Save(diskMesh,
"disc.off");
67 tri::io::ExporterOFF<MyMesh>::Save(platonicMesh,
"tetrahedron.off");
68 tri::Octahedron(platonicMesh);
69 tri::io::ExporterOFF<MyMesh>::Save(platonicMesh,
"octahedron.off");
70 tri::Hexahedron(platonicMesh);
71 tri::io::ExporterOFF<MyMesh>::Save(platonicMesh,
"hexahedron.off");
73 tri::io::ExporterOFF<MyMesh>::Save(platonicMesh,
"dodecahedron.off");
74 tri::Icosahedron(platonicMesh);
75 tri::io::ExporterOFF<MyMesh>::Save(platonicMesh,
"icosahedron.off");
79 tri::BuildPrismFaceShell(platonicMesh, facePrismMesh, 0.1f, 0.1f);
80 tri::io::ExporterOFF<MyMesh>::Save(facePrismMesh,
"facePrism.off");