Esempio n. 1
0
int 
main(int argc, char *argv[])
{
   if (argc != 1) {
      err_msg("Usage: %s < input.sm", argv[0]);
      return 1;
   }

   BMESHptr mesh = BMESH::read_jot_stream(cin);
   if (!mesh || mesh->empty())
      return 1; // didn't work
   mesh->print();

   return 0;
}
Esempio n. 2
0
int 
main(int argc, char *argv[])
{
   // -s option writes "simple" format, meaning faces are written as:
   //
   //   f 1 3 2
   //
   // instead of:
   //
   //   f 1//1 3//3 2//2

   bool do_simple = false;
   if (argc == 2 && string(argv[1]) == "-s") {
      do_simple = true;
   } else if (argc != 1) {
      err_msg("Usage: %s [ -s ] < input.sm > output.sm", argv[0]);
      return 1;
   }

   BMESHptr mesh = BMESH::read_jot_stream(cin);
   if (!mesh || mesh->empty())
      return 1; // didn't work

   if (Config::get_var_bool("JOT_RECENTER"))
      mesh->recenter();

   if (Config::get_var_bool("JOT_PRINT_MESH"))
      mesh->print();

   // write verts
   write_verts(*mesh, cout);

   // write faces
   write_faces(*mesh, cout, do_simple);

   return 0;
}
Esempio n. 3
0
int 
main(int argc, char *argv[])
{
   if (argc != 1) {
      err_msg("Usage: %s < input.sm > output.sm", argv[0]);
      return 1;
   }

   BMESHptr mesh = BMESH::read_jot_stream(cin);
   if (!mesh || mesh->empty())
      return 1; // didn't work

   // Remove duplicate vertices
   mesh->remove_duplicate_vertices(false); // don't keep the bastards

   if (Config::get_var_bool("JOT_PRINT_MESH"))
      mesh->print();

   color_verts(mesh->verts());

   mesh->write_stream(cout);

   return 0;
}