Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cpmesh.C

Go to the documentation of this file.
00001 /**********************************************************************
00002  * cpmesh.C:
00003  **********************************************************************/
00004 #include "std/config.H"
00005 #include "mi.H"
00006 
00007 int 
00008 main(int argc, char *argv[])
00009 {
00010    if (argc != 1) {
00011       err_msg("Usage: %s < input.sm > output.sm", argv[0]);
00012       return 1;
00013    }
00014 
00015    BMESHptr mesh = BMESH::read_jot_stream(cin);
00016    if (!mesh || mesh->empty())
00017       return 1; // didn't work
00018 
00019    // Remove duplicate vertices
00020    mesh->remove_duplicate_vertices(false); // don't keep the bastards
00021 
00022    bool is_bad = false;
00023    for (int i=0; i<mesh->nedges(); i++)
00024       if (!mesh->be(i)->consistent_orientation())
00025          is_bad = true;
00026    if (is_bad)
00027       err_msg("Warning: inconsistently oriented triangles -- can't fix");
00028 
00029    if (Config::get_var_bool("JOT_COMPUTE_CREASES"))
00030       mesh->compute_creases();
00031 
00032    if (Config::get_var_bool("JOT_RECENTER"))
00033       mesh->recenter();
00034 
00035    if (Config::get_var_bool("JOT_PRINT_MESH"))
00036       mesh->print();
00037 
00038    mesh->write_stream(cout);
00039 
00040    return 0;
00041 }

Generated on Mon Sep 18 11:39:29 2006 for jot by  doxygen 1.4.4