我正在使用
当我使用网站上的代码示例(https://cgal.geometryfactory.com/CGAL/doc/master/Polygon_mesh_processing/Polygon_mesh_processing_2corefinement_mesh_union_8cpp-example.html)和提供的off文件blobby.off和eight.off时,一切都很顺利。
不幸的是,当我使用其他off文件时,我遇到了一个我不理解的错误:
你可以在这里找到我使用的文件: https://pool234.seedbox.fr/files/index.php/s/H87xL0Ema9HC44P (密码:share)
感谢你的帮助。
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.off和eight.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)
感谢你的帮助。
mesh2.off
不是有效的输入网格(由于重复边缘而导致的自相交)。如果您首先通过调用CGAL::Polygon_mesh_processing::stitch_borders()
来修复它,您将得到您想要的结果。 - sloriot