我正在开发一个软件,它生成一个多边形网格来表示一个球体,我想在球体上切一个洞。这个多边形网格只是球体表面的覆盖。我很清楚如何确定哪些多边形会与我的洞相交,我可以将它们从我的收藏中删除,但在那之后我有点困惑。我想知道是否有人可以帮助我了解高级概念?
基本上,我设想了三种情况:
1.) The cylindrical hole does not intersect my sphere.
2.) The cylindrical hole partially goes through my sphere.
3.) The cylindrical hole goes all the way through my sphere.
对于#1,我可以对此进行测试(不删除多边形)并采取相应的行动(什么也不做)。对于#2 和#3,我不确定如何重新镶嵌我的球体以解决这个洞。对于#3,我有一个想法,基本上是以下几行:
a.) Find your entry point (a circle)
b.) Find your exit point (a circle)
c.) Remove the necessary polygons
d.) Make new polygons along the 4* 'sides' of the hole to keep my
sphere a manifold.
这个极其简化的算法有一些我想填补的“洞”。例如,我实际上并不希望我的洞有 4 个边——它应该是一个圆柱体,或者至少是一个圆柱体的镶嵌表示。我也不确定如何制作这些新的多边形以使我的球体在镶嵌表面上留有一个洞。
我不知道如何处理场景 #2。