フィルターのクリア

pair of neighboring triangles from triangulation.

5 ビュー (過去 30 日間)
T Abraham
T Abraham 2018 年 1 月 7 日
回答済み: John D'Errico 2018 年 1 月 7 日
I need to calculate the so-called discrete bending energy of a randomly triangulated sphere. The discrete bending energy is defined as shown in the attached image. Simply put, it is a sum that runs over all pairs of neighboring triangles, and n_i is the surface normal vector of triangle i. So I have used the triangulation class since it is able to output the neighbors (neighbors() function), and the normal vector (faceNormal() function). The question that I have is how do I run over all pairs of neighboring triangles without duplicates? Below I have code that runs over the pairs, but there will obviously be duplicates? How do I fix that? Do I have to keep track of the pairs that have been accounted for? Is there a way to make the neighhbors matrix only have the unique neighbors?
T = triangulation(FBtri,FBpoints);
FN = faceNormal(T); % normal vectors
N = neighbors(T) % neighbors matrix
E_b = 0; % Bending energy
for i = 1:size(N,1)
for j = 1:size(N,2)
E_b = E_b + (1-dot(FN(i,:),FN(N(i,j),:)));
end
end

回答 (1 件)

John D'Errico
John D'Errico 2018 年 1 月 7 日
I would simply start with the list of all triangles.
Sort all triangles to list the vertices in increasing order of node from the original point set. That makes the duplicated edges consistent, so you don't have flipped edges to worry about.
Next, get all edges. Each triangle has three edges. Don't worry about duplicates. In fact, the duplicated edges in that list are important.
All edges will appear once only on boundary triangles, unless the triangulation describes a closed surface. All other edges appear twice.
So for every edge that did appear twice, you can link back to the two triangles that supplied that edge. In fact, all of this can be done in vectorized form. (I know, because I did a similar computation once, essentially computing a bending energy for a triangulation.)

カテゴリ

Help Center および File ExchangeDelaunay Triangulation についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by