c++ - CGAL Triangulated Surface Mesh Shortest Paths 算法 - 断言错误
问题描述
我正在试验 CGAL 库的Triangulated Surface Mesh Shortest Paths算法。我正在使用以下三角方形案例进行测试:
当我尝试计算任意两个顶点之间的最短距离时,总是会出现以下两个错误之一:
错误1:
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: baseOrientation != CGAL::COLLINEAR
File: /usr/local/include/CGAL/Surface_mesh_shortest_path/function_objects.h
Line: 588
错误2:
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: _idx < data_.size()
File: /usr/local/include/CGAL/Surface_mesh/Properties.h
Line: 204
您可以在此处下载包含非格式网格的最小代码示例。我遵循了 CGAL 网站上显示的实现。编译需要 CGAL 和 gmp 库:
g++ main.cpp -lCGAL -lgmp
可执行文件需要两个参数:源点和目标点的索引:
a.out 2 6
尝试 2 和 6 获得第一个错误,或尝试 0 和 2 获得第二个错误。
解决方案
推荐阅读
- module - 计算创建依赖于现有内置模块的新 odoo 模块的费用
- javascript - 在angularjs(2k行)中加载大量数据后浏览器被冻结
- python - 比较列表(A)中的项目是否作为列表(B)中的子项目存在
- c# - Wpf 绑定 Observablecollection 和 RelayCommand
- html - 我应该用
or a read-only
- reactjs - 我有 2 个组件,我想要第 3 个组件在等待第 2 个组件加载图像时显示动画
- ios - Gigya Swift Facebook 和 Google Native 登录
- django-models - 身份验证失败:登录页面返回数据库中已有用户的 DoesNotEXist
- python - 提取图像最大像素值的位置
- javascript - 如何按城市或 bbox 限制 Leaflet-control-geocoder 结果?