将 3d 网格分解为 2d 网络

发布于 2024-07-23 14:06:41 字数 465 浏览 9 评论 0原文

假设您有一个 3 维对象,以某种常见文件格式表示为 3d 网格。 您将如何设计一种算法将网格分解为一个或多个 2d“网”,即可以剪切和折叠以创建原始 3d 对象的 2 维表示形式。

除其他事项外,该算法需要考虑:

  • 任何给定对象的多种可能的分解
  • 处理将网格拟合到固定大小的画布(纸张)中。
  • 识别网络中的两个面板何时重叠(因此无效)。
  • 如果由于重叠或页面大小限制而无法将网格表示为单个网络,则将网格分解为多个网络。
  • 在适当的位置生成选项卡,用于连接相邻的面。

明显的退化情况是简单地为每个面创建一个网,并在一半边缘上设置标签。 显然,这并不理想:理想的情况是单个连续网络。 复杂形状的实际情况可能介于两者之间。

我意识到寻找最佳网络(最少的网络/最少的页面)可能在计算上很昂贵,但是寻找“足够好”网络的良好启发式就足够了。

Suppose you have a 3 dimensional object, represented as a 3d mesh in some common file format. How would you devise an algorithm to decompose the mesh into one or more 2d 'nets' - that is, a 2-dimensional representation that can be cut out and folded to create the original 3d object.

Amongst other things, the algorithm would need to account for:

  • Multiple possible decompositions for any given object
  • Handling fitting a mesh into fixed size canvases (sheets of paper).
  • Recognizing when two panels in the net would overlap (and are thus invalid).
  • Breaking a mesh up into multiple nets if they can't be represented as a single one, due to overlap or page size constraints.
  • Generating tabs in the appropriate places, for attaching adjacent faces.

The obvious degenerate case is simply to create one net per face, with tabs on half the edges. This isn't ideal, obviously: The ideal case is a single continuous net. The reality for complex shapes is likely to be somewhere in the middle.

I realize that finding the optimal net (fewest nets / least pages) is probably computationally expensive, but a good heuristic for finding 'good enough' nets would suffice.

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

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

发布评论

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

评论(3

缪败 2024-07-30 14:06:41

当我读到你的问题时,我想到了“自动纸艺算法”这个词。 所以我用谷歌搜索并找到了使用通用圆柱体的纸艺模型(pdf)作者:Massarwi 等人。

我们提出了一种新的生产方法
展开的纸艺图案
圆形玩具动物人物
三角网格通过
基于条带的近似。 虽然在
原则上三角模型可以是
只需保留尽可能多的内容即可展开
尽可能的连接性,同时
检查相交三角形
展开的平面,创建一个图案
有数以万计的三角形
不切实际。 我们的方法是
通过一组近似网格模型
连续三角形带,无
内部顶点。 最初,我们
将我们的网格细分为多个部分
对应的特征
模型。 我们将每个部分分为区域
区域,将三角形分组为
相似的拓扑距离
部分边界。 我们生成三角形
通过简化网格来条带,同时
保留区域边界
区域和附加切割线。 这
然后简单地创建模式
展开这组条带。 这
我们方法的显着特征
是我们通过以下方式近似网格模型
一组连续的条带,不是由
其他直纹表面,例如零件的一部分
圆锥体或圆柱体。 就这样
近似的展开图案可以是
仅使用网格操作生成
和一个简单的展开算法。
此外,一组条带可以
只需弯曲纸张即可制作
(不破坏边缘)并且可以
代表平滑特征
原始网格模型。

还有一篇较早的相关论文,名为来自网格的纸工艺模型 (9MB pdf),作者:Shatz 等人。

本文介绍了一种算法
将网格分割为可展开的
近似值。 该算法可以是
用于 CAD 中的各种应用
和计算机图形学。 这张纸
专注于纸工艺和
证明该算法
生成近似值
可展开,易于切割,并且可以
粘在一起。 还表明
给定模型和之间的误差
纸模型很小。

在此处输入图像描述
来源:http://www.ee .technion.ac.il/~ayellet/images/sel-papers-pic-5.jpg

When I read your question, the words "automatic papercraft algorithm" came to me. So I googled it and found Papercraft Models using Generalized Cylinders (pdf) by Massarwi et al.

We propose a new method for producing
unfolded papercraft patterns of
rounded toy animal figures from
triangulated meshes by means of
strip-based approximation. Although in
principle a triangulated model can be
unfolded simply by retaining as much
as possible of its connectivity while
checking for intersecting triangles in
the unfolded plane, creating a pattern
with tens of thousands of triangles is
unrealistic. Our approach is to
approximate the mesh model by a set of
continuous triangle strips with no
internal vertices. Initially, we
subdivide our mesh into parts
corresponding to the features of the
model. We segment each part into zonal
regions, grouping triangles which are
similar topological distances from the
part boundary. We generate triangle
strips by simplifying the mesh while
retaining the borders of the zonal
regions and additional cut-lines. The
pattern is then created simply by
unfolding the set of strips. The
distinguishing feature of our method
is that we approximate a mesh model by
a set of continuous strips, not by
other ruled surfaces such as parts of
cones or cylinders. Thus, the
approximated unfolded pattern can be
generated using only mesh operations
and a simple unfolding algorithm.
Furthermore, a set of strips can be
crafted just by bending the paper
(without breaking edges) and can
represent smooth features of the
original mesh models.

There is also an earlier related paper called Paper craft models from meshes (9MB pdf) by Shatz et al.

This paper introduces an algorithm for
segmenting a mesh into developable
approximations. The algorithm can be
used in various applications in CAD
and computer graphics. This paper
focuses on paper crafting and
demonstrates that the algorithm
generates approximations that are
developable, easy to cut, and can be
glued together. It is also shown that
the error between the given model and
the paper model is small.

enter image description here
Source: http://www.ee.technion.ac.il/~ayellet/images/sel-papers-pic-5.jpg

独闯女儿国 2024-07-30 14:06:41

链接到的算法 eed3si9n 将从复杂的几何形状生成漂亮合理的纸艺网格。 如果您想完全按照建模方式展开网格(例如对于多面体模型),那么这里有一种相对简单的技术,可以按原样展开任何网格

从源网格构建一个图形,其中每个面都是图形中的一个顶点,如果两个顶点在网格中共享公共边,则它们是连接的。 当且仅当其中一个图没有循环时,即它是一棵树时,它才表示可展开的网格。

一棵好的树代表从起点到达最远面的最少折叠线,因为每次折叠都代表将在最终模型中累积的误差。 Dijkstra 算法在这里很好,但最小生成树不起作用。 由于每条边的权重相等,所有树都是最小生成树,即使是将网格展开成一个大螺旋的树也是如此。 当您将模型粘合在一起时,错误会不断累积,直到最后几个面根本不合适。

一旦你有了树,就开始在原点绘制你的起始面。 然后遍历树并通过计算新顶点作为两个圆的交点来添加新面,两个圆的半径对应于原始网格中边的长度。 选项卡的位置对应于原始网格中但不在可展平树中的边。

用户指定的切割可以在树步骤之前作为边缘删除来处理。

展开四面体的图

这种技术的一些缺点是它会很高兴地创建平面图案中的重叠部分,这取决于找到一个好的起始面。 我尝试 Floyd-Warshal 寻找一个最小直径的面作为起点,但它的 O(n^3) 行为导致咖啡休息时间过长。 可以通过将树的分支标记为“不完整”、跳过它并在所有不完整的面上重新运行算法来处理重叠部分。

The algorithms eed3si9n linked to will generate nice reasonable papercraft meshes from complicated geometry. If you'd like to unfold the mesh exactly as it is modeled, such as for polyhedra models, then here's a relatively simple technique for unfolding any mesh as it stand

Construct a graph from your source mesh where each face is a vertex in the graph, and two vertices are connected if they share a common edge in the mesh. One of these graphs represents an unfoldable mesh if and only if it has no loops, i.e. it is a tree.

A good tree represents the fewest fold lines to get to the farthest face from the starting point, since each fold represents error that will accumulate in the finished model. Dijkstra's algorithm is good here, but minimum spanning tree doesn't work. With each edge equally weighted all trees are minimum spanning trees, even one that would unfold your mesh into one big spiral. As you glued the model together, errors would build up until the last few faces didn't fit at all.

Once you have the tree, start by drawing your starting face at the origin. Then walk the tree and add the new faces by calculating the new vertex as the intersection of two circles with radii corresponding to the lengths of the edges in the original mesh. Locations for tabs correspond to edges that were in the original mesh, but are not in the flattenable tree.

User-specified cuts can be handled as edge deletions before the tree step.

diagram of unfolding a tetrahedron

Some downsides of this technique are that it will happily create overlapping parts in the flat pattern, and it is dependent on finding a good starting face. I tried Floyd-Warshal to find a minimum-diameter face to start from, but its O(n^3) behavior made for excessively long coffee breaks. The overlapping parts could be dealt with by marking that branch of the tree as "incomplete", skipping it, and re-running the algorithm on all incomplete faces again.

优雅的叶子 2024-07-30 14:06:41

我知道这不是答案,但它是相关的。 前 SGI 图形专家 Paul Haeberli 的 Lamina 程序是这个问题的解决方案。

I know this is not an answer, but it is related. Ex-SGI graphics guy Paul Haeberli's Lamina program is a solution for this problem.

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