4

从 3D 网格开始,如何为该网格的多边形之间的边和角赋予圆润的外观?


在不希望阻止其他方法的情况下,这是我目前解决问题的方式:

给定正多面体的网格,我可以通过沿其平面缩放每个多边形并使用圆柱段连接边缘,使每个圆柱与它与该多边形相交的每个多边形相切,从而使网格的边缘呈现圆形外观。

这是一个涉及立方体的示例:

立方体

这是缩放多边形后的立方体:

缩放多边形后的立方体

这是使用圆柱体连接多边形边缘后的立方体:

圆边立方体

我遇到的麻烦是弄清楚如何处理多边形之间的角,尤其是在每个角处有超过三个边相遇的情况下。我还想要一种适用于所有封闭多面体的算法,而不仅仅是那些规则的多面体。

4

5 回答 5

2

I post this as an answer because I can't put images into comments.

Sattle point

Here's an image of two brothers camping:

sattlepoint

They placed their simple tents right beside each other in the middle of a steep walley (that's one bad place for tents, but thats not the point), so one end of each tent points upwards. At the point where the four squares meet you have a sattle point. The two edges on top of each tent can be rounded normally as well as the two downward edges. But at the sattle point you have different curvature in both directions and therefore its not possible to use a sphere. This rules out Svante's solution.

Selfintersection

The following image shows some 3D polygons if viewed from the side. Its some sharp thing with a hole drilled into it from the other side. The left image shows it before, the right after rounding.

alt text .

The mass thats get removed from the sharp edge containts the end of the drill hole.

There is someething else to see here. The drill holes sides might be very large polygons (lets say it's not a hole but a slit). Still you only get small radii at the top. you can't just scale your polygons, you have to take into account the neighboring polygon.

Convexity

You say you're only removing mass, this is only true if your geometry is convex. Look at the image you posted. But now assume that the viewer is inside the volume. The radii turn away from you and therefore add mass.

NURBS

I'm not a nurbs specialist my self. But the constraints would look something like this: The corners of the nurbs patch must be at the same position as the corners of the scaled-down polygons. The normal vectors of the nurb surface at the corners must be equal to the normal of the polygon. This should be sufficent to gurarantee that the nurb edge will be a straight line following the polygon edge. The normals also ensure that no visible edges will result at the border between polygon and nurbs patch.

I'd just do the math myself. nurbs are just polygons. You'll have some unknown coefficients and your constraints. This gives you a system of equations (often linear) that you can solve.

于 2010-08-16T13:19:23.193 回答
1

在那个角落相遇的面数是否有上限?

您可能会使用来自 CAGD 的概念,尤其是非均匀有理 B 样条 (NURBS) 可能会引起您的兴趣。

您当前的方法 - 粘合一些固定的几何图元可能太不灵活而无法解决问题。NURBS 需要一些数学工作才能习惯,但可能更适合您的需求。

于 2010-08-14T22:32:52.550 回答
1

推断你的圆柱边缘方法,角落应该是球体,分别。球体段,其半径与在那里相遇的圆柱体具有相同的半径,并且中心位于圆柱体轴线的交点处。

于 2010-08-15T01:09:08.310 回答
1

在这里,我们有一个 C++ 头文件,用于生成三角圆角 3D 框。代码是 C++,但也很容易移植到其他编码语言。也很容易为其他基元(如四边形)进行修改。

https://github.com/nepluno/RoundCornerBox

于 2016-12-28T07:04:00.223 回答
0

正如@Raymond 建议的那样,我也认为nepluno repo提供了一个非常好的实现来解决这个问题;高效且简单。

为了完成他的回答,我刚刚在 JS 中写了一个解决这个问题的方法,基于 BabylonJS 3D 引擎。这个解决方案可以在这里找到,并且可以很容易地被另一个 3D 引擎替换:

https://playground.babylonjs.com/#AY7B23

于 2021-02-10T14:00:25.753 回答