Trimesh plots diferently using trimesh(TO) vs trimesh(T,x,y,z)

6 ビュー (過去 30 日間)
David
David 2025 年 8 月 22 日
コメント済み: Matt J 2025 年 8 月 25 日
Depending on the input format, I get different results for trimesh when I give it the same data, i.e the following produce different plots
trimesh(T0);
trimesh(T0.ConnectivityList',T0.Points(:,1)',T0.Points(:,2)',T0.Points(:,3)');

回答 (1 件)

Matt J
Matt J 2025 年 8 月 22 日
編集済み: Matt J 2025 年 8 月 22 日
You haven't attached your .mat file so we can't try to reproduce it. I would guess that the problem is that you've transposed the ConnectivityList for some reason. My attached example.mat demonstrates that that will give you wrong results.
load example
TO=triangulation(T, x, y,z);
subplot(1,3,1); trimesh(TO); axis vis3d
subplot(1,3,2); trimesh(TO.ConnectivityList,x,y,z); axis vis3d
subplot(1,3,3); trimesh(TO.ConnectivityList',x,y,z); axis vis3d
  3 件のコメント
Steven Lord
Steven Lord 2025 年 8 月 25 日
I've reported this to the development staff.
Matt J
Matt J 2025 年 8 月 25 日
Thank you!
You're welcome, but if this resolves your question, please Accept-click the Answer.
For some reasion trimesh wants the transpose of the xyz, but not the ConnectivityList.
You haven't attached your data (and we don't know your Matlab version you are using), but I can't reproduce that with my example.mat. The plot is indifferent to transposition of x,y,z.
load example
TO=triangulation(T, x, y,z);
subplot(1,3,1); trimesh(TO); axis vis3d
subplot(1,3,2); trimesh(TO.ConnectivityList,x,y,z); axis vis3d
subplot(1,3,3); trimesh(TO.ConnectivityList,x',y',z'); axis vis3d

サインインしてコメントする。

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by