gpt4 book ai didi

c++ - CGAL:为什么半平面用六射线表示?

转载 作者:行者123 更新时间:2023-12-02 10:01:27 27 4
gpt4 key购买 nike

我刚刚开始在飞机上使用Nef多面体-下面的简单程序创建了一个半平面,由y=0行定义,然后由CGAL Explorer探索该半平面。

#include <iostream>

#include <CGAL/Exact_integer.h>
#include <CGAL/Extended_cartesian.h>
#include <CGAL/Nef_polyhedron_2.h>

using Kernel = CGAL::Extended_cartesian<CGAL::Exact_integer>;
using Polyhedron = CGAL::Nef_polyhedron_2<Kernel>;
using Line = Polyhedron::Line;

using std::cout;
using std::endl;

int main()
{
const Polyhedron p(Line(0, 1, 0), Polyhedron::INCLUDED);
const auto ex = p.explorer();
for (auto it = ex.vertices_begin(); it != ex.vertices_end(); ++it)
{
if (ex.is_standard(it))
{
cout << "Point: " << ex.point(it) << endl;
}
else
{
cout << "Ray: " << ex.ray(it) << endl;
}
}
}

程序输出:
Ray:   0 0 -1 -1
Ray: 0 0 -1 0
Ray: 0 0 -1 1
Ray: 0 0 1 -1
Ray: 0 0 1 0
Ray: 0 0 1 1

为什么这六缕?

最佳答案

documentation中获取explorer:

By recursively composing binary and unary operations one can end with a very complex rectilinear structure. To explore that structure there is a data type Nef_polyhedron_2::Explorer that allows read-only exploration of the rectilinear structure.

Therefore the planar subdivision is bounded symbolically by an axis-parallel square box of infimaximal size centered at the origin of our coordinate system. All structures extending to infinity are pruned by the box. Lines and rays have symbolic endpoints on the box. Faces are circularly closed. Infimaximal here means that its geometric extend is always large enough (but finite for our intuition). Assume you approach the box with an affine point, then this point is always inside the box. The same holds for straight lines; they always intersect the box.


假设这些顶点在盒子上,我的最佳猜测是:
diagram
这是一个正方形,所以这就是为什么您会得到 0, 0 -> -1, 10, 0 -> 1, 1之类的对角线的原因。我不是专家。
编辑:工程图是上下颠倒的,半平面是 y >= 0,而不是 y <= 0

关于c++ - CGAL:为什么半平面用六射线表示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62400746/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com