三角形膜要素の分布図(任意の(x,y)座標で)を作成したいのですが、方法はありませんでしょうか。
8 views (last 30 days)
Show older comments
Hirotaka Nagahama
on 1 Aug 2019
Commented: Hirotaka Nagahama
on 2 Aug 2019
三角形メッシュの評価を行うのに、三角膜要素の分布図または等高線のようなものを可視化したいです。
任意の(x,y)を代入することで得られるz座標を三角要素の変位として表したいです。
どうしても散布図や三次元プロットを行うと四角形要素でしか表せません。
何かいい方法がございましたら、教えていただきたいです。
Accepted Answer
Akira Agata
on 2 Aug 2019
ご説明ありがとうございます。おおよそ理解しました。
まず、任意の (x,y) 座標に対して何らかの値 z (例えば関数 z = f(x,y) の出力値)があったとして、それらの隣接する点どうしを三角形で結んで3次元曲面として表示するには、以下のようにすれば可能です(念のため、各 x,y,z 座標を赤点で図中に示しています)。
% Sample data, assuming selected (x,y) and z = f(x,y) points
x = 2*rand(100,1);
y = 2*rand(100,1);
func = @(x,y) exp(-x.^2 - y.^2);
z = func(x,y);
% Delaunay triangulation
tri = delaunay(x,y);
% Triangular surface plot
figure
trisurf(tri,x,y,z)
hold on
scatter3(x,y,z,'ro','filled')
view([80 40])
また、上記 (x,y) 点群のうち、ある三角形の範囲内を対象にこのような図を作成するには、以下のような方法はいかがでしょうか?
(こちらも念のため、元の3次元曲面全体をワイヤーフレームで表示しています)
% Sample regular triangle
pgon = nsidedpoly(3,'Center',[1 1]);
idx = isinterior(pgon,x,y);
x2 = [x(idx); pgon.Vertices(:,1)];
y2 = [y(idx); pgon.Vertices(:,2)];
z2 = [z(idx); func(pgon.Vertices(:,1),pgon.Vertices(:,2))];
% Delaunay triangulation
tri2 = delaunay(x2,y2);
% Triangular surface plot
figure
trisurf(tri2,x2,y2,z2)
hold on
trisurf(tri,x,y,z,'FaceAlpha',0)
scatter3(x2,y2,z2,'ro','filled')
view([80 40])
More Answers (0)
See Also
Categories
Find more on LIDAR および点群の処理 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!