CGAL联合操作误解

3
我正在使用CGAL::Polygon_mesh_processing::corefine_and_compute_union()函数来计算2个网格的并集。
当我使用网站上的代码示例(https://cgal.geometryfactory.com/CGAL/doc/master/Polygon_mesh_processing/Polygon_mesh_processing_2corefinement_mesh_union_8cpp-example.html)和提供的off文件blobby.offeight.off时,一切都很顺利。
不幸的是,当我使用其他off文件时,我遇到了一个我不理解的错误:
CGAL error: assertion violation!
Expression : it_poly_hedge!=edge_to_hedge.end()
File       : /usr/local/include/CGAL/Polygon_mesh_processing/internal/Corefinement/Visitor.h
Line       : 1008

以下是Visitor.h文件中相关的代码:

    //WARNING: in few case this is needed if the marked edge is on the border
    //to optimize it might be better to only use sorted pair. TAG_SLXX1
    Node_id_pair opposite_pair(node_id_pair.second,node_id_pair.first);
    it_poly_hedge=edge_to_hedge.find(opposite_pair);
    CGAL_assertion( it_poly_hedge!=edge_to_hedge.end() );

你可以在这里找到我使用的文件: https://pool234.seedbox.fr/files/index.php/s/H87xL0Ema9HC44P (密码:share)
感谢你的帮助。

1
mesh2.off 不是有效的输入网格(由于重复边缘而导致的自相交)。如果您首先通过调用 CGAL::Polygon_mesh_processing::stitch_borders() 来修复它,您将得到您想要的结果。 - sloriot
做到了,非常感谢你。 - Barnabé Faliu
1
这些注释应该被转换成一个答案。 - Andreas Fabri
1个回答

2

这是sloriot的答案:

mesh2.off不是有效的输入网格(由于重复边缘而导致自相交)。如果您首先通过调用CGAL::Polygon_mesh_processing::stitch_borders()来修复它,您将得到您的结果。

谢谢


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接