首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在构造ss_circle.has_on时使用‘Nef_polyhedron’的断言冲突

在构造ss_circle.has_on时使用‘Nef_polyhedron’的断言冲突
EN

Stack Overflow用户
提问于 2021-06-24 13:21:02
回答 1查看 67关注 0票数 0

我希望使用Nef_polyhedron_3构造一个Polyhedron_3对象,而错误描述会发生断言冲突,如下所示:

代码语言:javascript
复制
CGAL error: assertion violation!
Expression : ss_circle.has_on(sp)
File       : ***\CGAL\Nef_3\polygon_mesh_to_nef_3.h
Line       : 255
Explanation:
Refer to the bug-reporting instructions at https://www.cgal.org/bug_report.html

以下是简化的代码:

代码语言:javascript
复制
#include <iostream>
#include <vector>
#include <fstream>
#include <future>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>

typedef CGAL::Cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;

void fill_cube(Polyhedron& poly)
{
    std::string input = R"(
OFF
5 5 0
1.10339 0.590945    0.0384615
1.10338 0.590775    0
1.105   0.63    0
1.105   0.63    0.0384615
1.1361  0.609828    0
4   3   2   1   0
3   2   4   1
3   2   3   4
3   3   0   4
3   0   1   4
)";
    std::stringstream ss;
    ss << input;
    ss >> poly;
}

int main()
{
    Polyhedron cube;
    fill_cube(cube);
    CGAL::Polygon_mesh_processing::triangulate_faces(cube);
    Nef_polyhedron N(cube);
    return 0;
}

如果使用Exact_predicates_exact_constructions_kernel,上面的代码可以工作,但是出现了线程安全问题,请参阅我的另一个问题同一多面体中Nef多面体的多线程构造问题

该程序运行在Windows和VS2019上。

那么我该如何解决这个问题呢?非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2021-06-25 07:15:28

CGAL::Cartesian<double>替换为内核,代之以精确的结构(如CGAL::Exact_predicates_exact_constructions_kernel )。

更多细节这里

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68116602

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档