【问题标题】:Is there any C++ library (for Linux) for repairing the non-manifold meshes and converting it to manifold geometry?是否有任何 C++ 库(用于 Linux)用于修复非流形网格并将其转换为流形几何?
【发布时间】:2020-09-06 12:57:09
【问题描述】:

我有一种算法的分割结果,但是,生成的三角形表面不是流形几何。我在这里问这个问题是否有任何 C++ 库可用于将非流形几何转换为流形曲面?

PS,我已经通过填充孔清理了结果,但似乎还有一些未平滑的部分和孔。

谢谢

【问题讨论】:

    标签: mesh cgal surface geometry-surface libigl


    【解决方案1】:

    是否有任何 C++ 库可用于将非流形几何转换为流形曲面?

    是的,有CGALC计算G几何A算法L库。

    在 CGAL 中,polygon mesh 被认为具有 2 流形拓扑。
    而当多边形网格的面被给定但连通性未知时,这组面被称为polygon soup。也就是说,你表面的所有三角形都会被分开处理。

    要将非流形表面转换为流形,您可以首先将数据加载到多边形汤中。
    然后转换使用函数polygon_soup_to_polygon_mesh 将它变成一个多边形网格。以下来自 CGAL 的code snippet 给出了一个示例:

    typedef CGAL::Exact_predicates_inexact_constructions_kernel          K;
    typedef CGAL::Polyhedron_3<K, CGAL::Polyhedron_items_with_id_3>      Polyhedron;
    
    std::ifstream input(filename);
    std::vector<K::Point_3> points;
    std::vector<std::vector<std::size_t> > polygons;
    if(!input || !CGAL::read_OFF(input, points, polygons) || points.empty())
    {
      std::cerr << "Cannot open file " << std::endl;
      return EXIT_FAILURE;
    }
    CGAL::Polygon_mesh_processing::orient_polygon_soup(points, polygons);
    Polyhedron mesh;
    CGAL::Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, mesh);
    

    或者您可以尝试修复here中描述的表面网格。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-09
      • 2013-06-05
      • 2013-12-17
      • 1970-01-01
      • 2010-09-26
      • 2011-05-18
      • 2013-01-07
      相关资源
      最近更新 更多