フィルターのクリア

I am interested in plotting a surface and eventually finding the curvature.

1 回表示 (過去 30 日間)
AB
AB 2016 年 8 月 22 日
コメント済み: Walter Roberson 2016 年 8 月 22 日
Hi!
I have a HyberSurface ASCII file with the following information stored in the file:
#HyperSurface 0.1 ASCII
Vertices 381042
coordinates of vertices are listed here
Triangles 798776
triangles are listed here
How do I read this file in matlab? If I try to load the data, it gives error as some of the lines are text. After that, how can I plot the surface (with triangles) with this data? Also, I am interested in finding curvature of this sphere to find put areas where it is convex/concave. Any good methods/scripts tutorials for that? I am new to MATLAB and any help will be appreciated. Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 8 月 22 日
fid = fopen('YurFile.txt', 'r');
numvert = cell2mat( textscan(fid, '%*s%f', 1));
vert_data = cell2mat( textscan(fid, '%f%f%f', numvert, 'CollectOutput', 1) );
numtri = cell2mat( textscan(fid, '%*s%f', 1));
tri_data = cell2mat( textscan(fid, '%f%f%f', numvert, 'CollectOutput', 1) );
fclose(fid);
You can probably use patch() to plot the data.
  2 件のコメント
AB
AB 2016 年 8 月 22 日
Hi
When I run these commands I get empty matrices of 0 by 3. Can you explain a little more? Thanks
Walter Roberson
Walter Roberson 2016 年 8 月 22 日
I would need an actual file to test with.

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

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by