本文整理汇总了C++中SurfaceMesh::write方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfaceMesh::write方法的具体用法?C++ SurfaceMesh::write怎么用?C++ SurfaceMesh::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfaceMesh
的用法示例。
在下文中一共展示了SurfaceMesh::write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv) {
std::string in_file = (argc>1) ? argv[1] : "bunny.obj";
std::string out_file = (argc>2) ? argv[2] : "output.obj";
// instantiate a SurfaceMesh object
SurfaceMesh mesh;
// read a mesh specified as the first command line argument
bool success = mesh.read(in_file);
CHECK(success);
// ...
// do fancy stuff with the mesh
// ...
// write the mesh to the file specified as second argument
mesh.write(out_file);
CHECK(success);
mLogger() << "read:" << in_file << "wrote:" << out_file;
return EXIT_SUCCESS;
}
示例2: main
int main(int argc, char** argv){
if(argc!=3){
cout << "usage:" << endl << "isoremesh bunny.obj remeshed.obj" << endl;
return EXIT_FAILURE;
}
std::string input(argv[1]);
std::string output(argv[2]);
///--- Load mesh
SurfaceMesh mesh;
mesh.read(input);
if(mesh.n_vertices()==0){
cout << "Input mesh has 0 vertices" << endl;
return EXIT_FAILURE;
}
///--- Remesher is only for triangulations!
mesh.triangulate();
///--- Compute bounding box
Scalar bbox_diag_length = bounding_box(mesh).diagonal().norm();
cout << "#vertices: " << mesh.n_vertices() << endl;
cout << "bbox_diag_length: " << bbox_diag_length << endl;
///--- Perform remeshing
IsotropicRemesher remesher(mesh);
remesher.num_iterations = 10;
remesher.sharp_feature_deg = 45;
remesher.longest_edge_length = 0.02*bbox_diag_length;
remesher.keep_short_edges = false;
remesher.reproject_to_surface = true;
remesher.myout = &std::cout; ///< print output to...
remesher.execute();
///--- Write to file
mesh.write(output);
return EXIT_SUCCESS;
}