如何从平面相交的 3D 几何体中提取 2D 切片?

发布于 2024-07-07 13:33:18 字数 397 浏览 2 评论 0原文

最近,我们的团队面临着在平面和一组​​ 3D 几何体(三角形集)之间构建 2D 切片的任务。 Google 并没有像我们希望的那样提供帮助,因此我们将注意力转向这里,看看是否有人遇到过此问题并提供可能的解决方案。 还想要链接。

找到交点本身并不是一项艰巨的任务,但确保使用正确的角组合正确生成三角形对我们来说是一项艰巨的任务。 我们只是缺乏对如何从任意模型构建三角形的数学/理解。

如果您无法理解我们想要做什么,请想象一下这种情况:

一个兔子模型被加载到程序中。 接下来,一道“激光”穿过太空,将兔子切成两半。 激光切割的薄片就是我们想要生成的切片。 它应该是一个二维三角形集。 如果激光无法为您切割(没有双关语),请考虑刀、刨子或任何可以在平面上切割物体的东西。

提前致谢。

Recently our team was facing the task to build the 2D slice between a plane and some set of 3D geometry (set of triangles). Google hasn't been as helpful as we have wanted it to be, so we turn our attention here to see if anyone has encountered this problem with a possible solution. Links are also wanted.

Finding the intersection points in itself isn't a hard task, but ensuring triangles being generated correctly with correct corner composition is playing a hard game with us. We simply lack the math/understanding of how triangle construction from an arbirtrary model is done.

If you have problems understanding what we're trying to do, imagine this scenario:

A bunny model is loaded into the program. Next a "laser" travels across space, cutting the bunny in half. That thin slice that the laser cut is the slice we want to generate. It should be a 2D triangle set. If laser doesn't cut it for you (no pun intended), think knife, plane, anything that slices something across a plane.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回忆凄美了谁 2024-07-14 13:33:18

如果您没有使用任何特定软件,请在 ParaView (paraview.org) 或 ParaViewGeo (paraviewgeo.mirarco.org) 中打开您的数据集。

两者都有一个名为 Slice 的过滤器,它的作用正是您所说的,并且都允许您保存数据。

ParaViewGeo 支持勘探/采矿/地质行业常用的数据格式(GoCad、DataMine 等),这是这两个软件之间的唯一真正区别。

这些软件包中还有许多其他过滤器,您可能会感兴趣,例如剪辑(将兔子切成两半并查看其中一半)和阈值(假设您为兔子的某些部分分配了值,例如区域 ID,例如耳朵、鼻子、眼睛、脚等,您可以“设置阈值”,以便只留下这些部分来查看)

If you're not tied to any particular software, open your data set in ParaView (paraview.org) or ParaViewGeo (paraviewgeo.mirarco.org).

Both have a filter called Slice that does excactly what you're talking about and both allow you to save your data back out.

ParaViewGeo supports data formats (GoCad, DataMine, and others) commonly used by the exploration/mining/geology industry and that is the only real difference between the two pieces of software.

There are also many other filters available in these software packages you may find interesting, such as Clip (cut your bunny in half and view one of the halves), and Threshold (say you assigned values to parts of your bunny, e.g. region id's like ears, nose, eyes, feet, etc you could "threshold" so that only those parts are left over to view)

鹊巢 2024-07-14 13:33:18

我真的不知道“角构图”是什么意思,但我想这是为了获得不太尖锐的三角形。

我还认为您的问题可以抽象为轮廓的三角测量?

如果是这样,我相信您可以在网上找到很多方法。

我会尝试的一种方法是:

  1. 用点填充轮廓。 点的密度应反映轮廓上点的密度。 更好的是,当您远离中心时,密度应该会降低。
  2. 使用 Delaunay 三角剖分进行三角剖分(QHull 提供了有效的实现)

对于第一点,飞镖投掷算法应该做诀窍是,用可变密度来优化第二步。 这意味着:你投掷“飞镖”来找到你的分数,但如果飞镖距离它的邻居太近,你就将其移开并投掷一个新的飞镖。

I don't really know what you mean by "corner composition", but I suppose this is to obtain triangles not too sharp.

I suppose also that your problem can then be abstracted to the triangulation of a contour?

If so, I am sure you can find plenty of methods on the net.

One method I would try would be:

  1. fill in your contour with points. The density of your points should reflect the density of the points on your contour. Even better, the density should decrease when you go away from the center.
  2. triangulate using the Delaunay triangulation (QHull provides an efficient implementation)

For the first point, a dart-throwing algorithm should do the trick, with variable density to optimize the second step. This means: you throw 'darts' to find your points, but if a dart end up too close from its neighbor, you remove it and throw a new one.

饭团 2024-07-14 13:33:18

平面和三角形的交点是一条线段或什么都不是(忽略三角形恰好在平面中的退化情况)。

因此,激光/刀扫描/切片兔子模型三角形的结果是线段的集合。 我不确定您如何/为什么期望得到一个“2D 三角形集”作为结果。

如果您想获取由这些线段形成的(可能是非凸的)多边形并用三角形“填充它们”,CGAL 的多边形工具 可能会完成这项工作(我猜该页面上的几张图片类似于您想要实现的目标)。

The intersection of a plane and a triangle is a line segment or nothing (ignoring the degenerate case of the triangle being exactly in the plane).

So the result of your laser/knife scanning/slicing across the bunny model triangles is a collection of line segments. I'm not sure how/why you'd expect to get a "2D triangle set" out as a result.

If you want to take the (possibly non-convex) polygon(s) formed by those line segments and "fill them in" with triangles, CGAL's polygon tools might do the job (my guess is the couple of pictures on that page are something like what you're trying to achieve).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文