本文整理汇总了C++中PolyhedronPtr::get_mesh方法的典型用法代码示例。如果您正苦于以下问题:C++ PolyhedronPtr::get_mesh方法的具体用法?C++ PolyhedronPtr::get_mesh怎么用?C++ PolyhedronPtr::get_mesh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PolyhedronPtr
的用法示例。
在下文中一共展示了PolyhedronPtr::get_mesh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
if (argc != 3)
{
std::cerr << "syntax: convexify <input> <output>" << std::endl;
std::cerr << std::endl;
std::cerr << "convexify takes the description of a 3D geometry from the input file (a Wavefront OBJ" << std::endl;
std::cerr << "file) and constructs a new Wavefront 3D file of the convex hull of that file." << std::endl;
return -1;
}
// read in the file
IndexedTriArray mesh = IndexedTriArray::read_from_obj(std::string(argv[1]));
// get the vertices
const std::vector<Origin3d>& vertices = mesh.get_vertices();
// compute the convex hull
PolyhedronPtr p = CompGeom::calc_convex_hull(vertices.begin(), vertices.end());
// write the resulting mesh to the output file
if (!p)
{
std::cerr << "convexify() - fatal error computing convex hull! (sorry I can't tell you more!" << std::endl;
return -1;
}
// write the file
p->get_mesh().write_to_obj(std::string(argv[2]));
}