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

时间:2022-11-12 13:37:46

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.

最近,我们的团队正面临着在平面和一组​​3D几何体(三角形集)之间构建2D切片的任务。谷歌并没有像我们希望的那样有用,所以我们把注意力转向这里,看看是否有人遇到过这个问题的可能解决方案。也需要链接。

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.

兔子模型被加载到程序中。接下来,“激光”穿越太空,将兔子切成两半。激光切割的薄切片是我们想要生成的切片。它应该是2D三角形集。如果激光没有为你剪切(没有双关语),可以考虑刀,平面,任何在飞机上切片的东西。

Thanks in advance.

提前致谢。

3 个解决方案

#1


2  

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

如果您没有绑定任何特定软件,请在ParaView(paraview.org)或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.

两者都有一个名为Slice的过滤器,它完全按照您所说的内容进行操作,并且允许您将数据保存回来。

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.

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

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)

在这些软件包中还有许多其他过滤器可供您感兴趣,例如Clip(将您的兔子切成两半并查看其中一半)和阈值(假设您为兔子的某些部分指定了值,例如区域id就像耳朵,鼻子,眼睛,脚等你可以“阈值”,这样只留下那些部分来查看)

#2


1  

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. 用点填充你的轮廓。点的密度应反映轮廓上点的密度。更好的是,当你离开中心时,密度会降低。

  3. triangulate using the Delaunay triangulation (QHull provides an efficient implementation)
  4. 使用Delaunay三角剖分进行三角测量(QHull提供了有效的实现)

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.

对于第一点,投掷镖算法应该做到这一点,用可变密度来优化第二步。这意味着:你投掷'飞镖'来找到你的分数,但是如果一个飞镖最终离它的邻居太近了,你将它移除并扔一个新的。

#3


0  

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.

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

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).

如果你想拍摄由那些线段形成的(可能是非凸的)多边形并用三角形“填充”,CGAL的多边形工具可能会完成这项工作(我的猜测是该页面上的几张图片是某些东西就像你想要实现的那样)。

#1


2  

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

如果您没有绑定任何特定软件,请在ParaView(paraview.org)或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.

两者都有一个名为Slice的过滤器,它完全按照您所说的内容进行操作,并且允许您将数据保存回来。

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.

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

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)

在这些软件包中还有许多其他过滤器可供您感兴趣,例如Clip(将您的兔子切成两半并查看其中一半)和阈值(假设您为兔子的某些部分指定了值,例如区域id就像耳朵,鼻子,眼睛,脚等你可以“阈值”,这样只留下那些部分来查看)

#2


1  

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. 用点填充你的轮廓。点的密度应反映轮廓上点的密度。更好的是,当你离开中心时,密度会降低。

  3. triangulate using the Delaunay triangulation (QHull provides an efficient implementation)
  4. 使用Delaunay三角剖分进行三角测量(QHull提供了有效的实现)

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.

对于第一点,投掷镖算法应该做到这一点,用可变密度来优化第二步。这意味着:你投掷'飞镖'来找到你的分数,但是如果一个飞镖最终离它的邻居太近了,你将它移除并扔一个新的。

#3


0  

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.

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

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).

如果你想拍摄由那些线段形成的(可能是非凸的)多边形并用三角形“填充”,CGAL的多边形工具可能会完成这项工作(我的猜测是该页面上的几张图片是某些东西就像你想要实现的那样)。