- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 CGAL 4.13 和以下代码片段对多面体的面进行三角剖分,该代码片段在 stdin 上采用 OFF 格式的多面体定义文件:
#include <CGAL/Polyhedron_3.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
using namespace std;
int main (void) {
Polyhedron p;
cin >> p;
if (!CGAL::Polygon_mesh_processing::triangulate_faces(p))
cerr << p << endl << "Triangulation failed!" << endl;
}
但是,我观察到以下警告:
CGAL warning: check violation! Expression : false File : /usr/include/CGAL/Constrained_triangulation_2.h Line : 902 Explanation: You are using an exact number type, using a Constrained_triangulation_plus_2 class would avoid cascading intersection computation and be much more efficient This message is shown only if CGAL_NO_CDT_2_WARNINGis not defined.
Refer to the bug-reporting instructions at https://www.cgal.org/bug_report.html
三角测量失败。消息 Triangulation failed!
与多面体定义一起打印出来,它清楚地显示了一些具有 5 个甚至 7 个顶点的面。
不幸的是,多面体的 OFF 表示有 8070 行长,我未能创建一个更小的示例来重现该问题。所以我上传了here .它在那里只有 30 天可用,如果有人可以建议一个更好的上传位置,我会考虑的。
编译后,例如用
g++ -O3 tri.cpp -o tri -lCGAL -lgmp -lmpfr -Wall
问题可以重现
./tri < poly.off
我不确定三角测量失败是否与警告有关;我如何将 Constrained_triangulation_plus_2
类与 CGAL::Polygon_mesh_processing::triangulate_faces()
一起使用?这可能吗?人脸三角剖分不是什么复杂的事情,怎么会失败呢?
最佳答案
如果您不需要精确的内核,您应该使用 CGAL::Exact_predicates_inexact_constructions_kernel
,这将使警告静音,然后三角剖分可能不会失败。如果你确实需要一个确切的内核,你可以使用 CGAL::copy_face_graph()
轻松地从 Epeck 切换到 Epeck,进行三角测量,然后切换回 Epeck。
关于c++ - 多面体三角剖分失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55120880/
稍后编辑:我上传了here我的原始数据的样本。它实际上是DICOM格式的分割图像。该结构的体积约为16 mL,因此我假设内部椭球体的体积应小于该体积。从DICOM图像中提取点,我使用了以下代码: im
我一直在寻找任何 C++ 库,它允许我获得线和多面体/球体之间的 3D 碰撞点(其中线由两个 3D 点和有限数量的 3D 点组成的多面体) 令我惊讶的是,我似乎找不到这样的库(或者我不知道要搜索哪些短
当我们尝试保存值时,为什么 PostGIS 不验证 GEOMETRY 字段的 longitude 和 latitude latitude 大于 90(latitude > 90)? 最佳答案 看看这张
我正在尝试使用 Wicket 插件制作一个多面体对象。我开始使用该插件,但现在我有点飘飘然了。如果我能弄清楚如何使用它,那将对我有很大帮助。 我也是 leaflet 的新手,并不真正理解文档中关于多面
除了这个之外,还有其他方法可以在 Three.js 中创建多边形/多面体吗? var polyhedronPts = []; polyhedronPts.push( new THREE.Vector2
我有这个几何形状文件,所以没有城市 map 。 我将其作为 GeoJson 存储在 GIS 数据库中。现在,我想可视化 geojson 数据。我首先使用 QGIS 创建了 GeoJson 数据并将其导
有没有模拟 3D polyhedra 的 JavaScript 库?使用 Canvas 标签或 SVG?假设我想制作 Platonic solids 的效果图,我将如何最好地实现这一目标? FWIW,
我一直在利用空闲时间编写一个游戏引擎,但为了让碰撞发挥作用,我被困了几个星期。 目前我用 AABB 表示实体的碰撞体,关卡的碰撞体由一个相当简单(但不一定是凸面)的多面体表示。所有的绘图都是基于 sp
我需要找到一种方法来解决在不使用设计工具的情况下为非凸多面体生成纹理贴图的问题。具体来说,我将模拟结果数据映射到 3D 表面上。也就是说,在代码中(最好是 C# 或 VB,因为我的目标是 WPF 3D
我是一名优秀的程序员,十分优秀!