poster
2019-12-10, 16:49
我有一个多面体,其中包含顶点( v )和曲面( s )的列表。如何将这个多面体分解为一系列的四面体?
我特别想知道是否有内置的MATLAB命令。
回答:
我建议尝试使用内置函数DELAUNAY3 (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunay3.html) 。文档链接中给出的示例类似于Aaron的答案 (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1838578#1838578) ,因为它使用了顶点加上多面体的中心点来创建3-D Delaunay细分,但是shabbychef (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1841507#1841507)指出,您仍然可以在不包括额外点的情况下创建细分。然后,您可以使用TETRAMESH (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tetramesh.html)可视化生成的四面体元素。
您的代码可能看起来像这样(假设v是顶点坐标值的N×3矩阵):
v = [v; mean(v)]; %# Add an additional center point, if desired (this code %# adds the mean of the vertices) Tes = delaunay3(v(:,1),v(:,2),v(:,3)); %# Create the triangulation tetramesh(Tes,v); %# Plot the tetrahedrons 由于您在评论中说您的多面体是凸面的,因此您不必担心将曲面指定为约束来进行三角剖分(与下面的评论相比, shabbychef (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1841507#1841507)似乎提供了更为严格和简洁的证明) 。
注意:根据文档,DELAUNAY3将在将来的版本中删除,而DelaunayTri (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunaytri.html)将有效地代替它(尽管目前看来,定义约束边仍仅限于二维三角剖分)。为了完整起见,以下是使用DelaunayTri并可视化凸包(即多面体表面)的方法:
DT = DelaunayTri(v); %# Using the same variable v as above tetramesh(DT); %# Plot the tetrahedrons figure; %# Make new figure window ch = convexHull(DT); %# Get the convex hull trisurf(ch,v(:,1),v(:,2),v(:,3),'FaceColor','cyan'); %# Plot the convex hull
更多&回答... (https://stackoverflow.com/questions/1838537)
我特别想知道是否有内置的MATLAB命令。
回答:
我建议尝试使用内置函数DELAUNAY3 (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunay3.html) 。文档链接中给出的示例类似于Aaron的答案 (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1838578#1838578) ,因为它使用了顶点加上多面体的中心点来创建3-D Delaunay细分,但是shabbychef (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1841507#1841507)指出,您仍然可以在不包括额外点的情况下创建细分。然后,您可以使用TETRAMESH (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/tetramesh.html)可视化生成的四面体元素。
您的代码可能看起来像这样(假设v是顶点坐标值的N×3矩阵):
v = [v; mean(v)]; %# Add an additional center point, if desired (this code %# adds the mean of the vertices) Tes = delaunay3(v(:,1),v(:,2),v(:,3)); %# Create the triangulation tetramesh(Tes,v); %# Plot the tetrahedrons 由于您在评论中说您的多面体是凸面的,因此您不必担心将曲面指定为约束来进行三角剖分(与下面的评论相比, shabbychef (https://stackoverflow.com/questions/1838537/break-polyhedron-into-tetrahedron/1841507#1841507)似乎提供了更为严格和简洁的证明) 。
注意:根据文档,DELAUNAY3将在将来的版本中删除,而DelaunayTri (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/delaunaytri.html)将有效地代替它(尽管目前看来,定义约束边仍仅限于二维三角剖分)。为了完整起见,以下是使用DelaunayTri并可视化凸包(即多面体表面)的方法:
DT = DelaunayTri(v); %# Using the same variable v as above tetramesh(DT); %# Plot the tetrahedrons figure; %# Make new figure window ch = convexHull(DT); %# Get the convex hull trisurf(ch,v(:,1),v(:,2),v(:,3),'FaceColor','cyan'); %# Plot the convex hull
更多&回答... (https://stackoverflow.com/questions/1838537)